Skip to content

OpenHAB Integration / Alexa Integration

OpenHAB is a vendor and technology agnostic open source automation software for your home. It allows you to integrate a wide range of devices and technologies, including NextCP/2 media.

NextCP/2 can be integrated into OpenHAB to control media playback, volume, and other features through a unified interface. This integration allows you to use voice commands via Amazon Alexa to control your NextCP/2 instance.

The easiest way to install OpenHAB is by using a docker image. After installation go to Settings -> Add-on Store -> Bindings and add the http binding. Then continue with the configuration of the Amazon Alexa Smart Home Skill.

Configuration steps
  • Go to Settings -> Things and add a thing by pressing the plus sign.
  • Click on http binding
  • Click on HTTP URL Thing
  • Set label to ‘NextCP2’, location to ‘server'
  • 'base-url’ must point to your NextCP/2 installation : http://192.168.1.5:8085/SimpleDeviceControl. Change host and port according to your configuration.

Go to NextCP/2 window and identify the device you want to control in the “App Settings” and copy the DEVICE_UUID. Go back to OpenHAB window.

Configuration steps
  • Click on the new added thing and click on channels.
  • Click on add channel.
  • Select Switch-Channel.
  • Configure the channel by adding a label like “Amplifier Power”.
  • Enter for “command url extension” /standby/DEVICE_UUID/%2$s
  • Enter for “status url extension” /standby/DEVICE_UUID
  • Enter for “ON value” false
  • Enter for “OFF value” true
  • SAVE
  • In the channel overview. Identify the new created channel “Amplifier Power” and click on “Add link to item”
  • Click on “create new item”. Choose an identifying name that will be used in Alexa later like “Amplifier”. Click on “link”.

Go to NextCP/2 window and identify the device you want to control in the “App Settings” and remember the DEVICE_UUID. Then identify the Radio station by clicking on “Radio” url encode the radio label and remember it. It is sufficient to copy only the first parts of the radio station label, that uniquely identifies the radio station. Go back to OpenHAB window.

Configuration steps
  • Click on the new added thing and click on channels.
  • Click on add channel.
  • Select Switch-Channel.
  • Configure the channel by adding a label like “Amplifier Power”.
  • Enter for “command url extension” /standby/DEVICE_UUID/%2$s
  • Enter for “status url extension” /standby/DEVICE_UUID
  • Enter for “ON value” false
  • Enter for “OFF value” true
  • SAVE
  • In the channel overview. Identify the new created channel “Amplifier Power” and click on “Add link to item”
  • Click on “create new item”. Choose an identifying name that will be used in Alexa later like “Amplifier”. Click on “link”.
Configuration steps
  • Click on Settings -> Items
  • Select the create Power ON/OFF item.
  • Click “Add Metadata”
  • Select “Amazon Alexa”

Rules can be used to further customization. Let’s say if OpenHAB receives the POWER ON command for the amplifier (i.e. from Alexa), it should also play radio energy.

Configuration steps
  • Click on Settings -> Rules
  • Give a label
  • For “When” click “Add Trigger”
  • select the “Amplifier Power” item
  • For “COMMAND” enter “ON”
  • Press save
  • For “Then” click “Add Action”
  • select the “Play Radio Energy” item
  • For “COMMAND” enter “PLAY”
  • Press save

Now, the Amplifier should be visible in Alexa-App. You should be able to say “Alexa, power on Amplifier”. As a result, your device should power on and Radio Energy should be played.