From 3394559539d69cfd06afab870dd96476553fedb0 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Fri, 26 Jan 2018 10:54:31 +0100 Subject: [PATCH 1/6] docs: remove basic script setup section It is not best practice to run an application this way. --- README.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/README.md b/README.md index e59b573..cf4f4b3 100644 --- a/README.md +++ b/README.md @@ -115,34 +115,7 @@ To look at the log, the output goes into the system log at `/var/log/syslog': ``` pi@raspberrypi:~ $ tail -f /var/log/syslog ``` -#### Basic script setup to run the bridge on a pi. -*NOTE ON RC.LOCAL*: Due to the way network subsystem is brought up on the pi, it uses the new systemctl to start services. The old style runlevel setup, which rc.local is part of does not get the benefit of knowing if the network has been fully realized. Starting ha-bridge from rc.local on next gen systems will cause unexpected results and issues with discovering registered devices. - -Edit the shell script for starting: -``` -pi@raspberrypi:~/habridge $ nano starthabridge.sh -``` -Then cut and past this, modify any locations that are not correct -``` -cd /home/pi/habridge -rm /home/pi/habridge/habridge-log.txt -nohup java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-5.1.0.jar > /home/pi/habridge/habridge-log.txt 2>&1 & - -chmod 777 /home/pi/habridge/habridge-log.txt -``` -Exit and save the file with ctrl-X and follow the prompts and then execute on the command line: -``` -pi@raspberrypi:~/habridge $ chmod u+x starthabridge.sh -``` -Then execute the script: -``` -pi@raspberrypi:~/habridge $ ./starthabridge.sh -``` -You should now be running the bridge. Check for errors: -``` -pi@raspberrypi:~/habridge $ tail -f habridge-log.txt -``` ## Run ha-bridge alongside web server already on port 80 These examples will help you proxy your current webserver requests to the ha-bridge running on a different port, such as 8080. From 4a24d263c11dd4b7fc40ccfae1c4b2f80ccfc540 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Fri, 26 Jan 2018 13:02:59 +0100 Subject: [PATCH 2/6] docs: rewrite manual installation section --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cf4f4b3..3e06989 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,10 @@ ATTENTION: Due to port 80 being the default, Linux restricts this to super user. ``` java -jar ha-bridge-5.1.0.jar ``` -### Automation on Linux systems -To have this configured and running automatically there are a few resources to use. One is using Docker and a docker container has been built for this and can be gotten here: https://github.com/aptalca/docker-ha-bridge + +### Manual installation of ha-bridge and setup of systemd service +Next gen Linux systems (this includes the Raspberry Pi), use systemd to run and manage services. +Here is a link on how to use systemd: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units Create the directory and make sure that ha-bridge-5.1.0.jar is in your /home/pi/habridge directory. ``` @@ -74,10 +76,7 @@ pi@raspberrypi:~ $ cd habridge pi@raspberrypi:~/habridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.1.0/ha-bridge-5.1.0.jar ``` -#### System Control Setup on a pi (preferred) -For next gen Linux systems (this includes the Raspberry Pi), here is a systemctl unit file that you can install. Here is a link on how to do this: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units - -Start here to create the habridge.service unit file: +Create the habridge.service unit file: ``` pi@raspberrypi:~ $ cd /etc/systemd/system pi@raspberrypi:~ $ sudo nano habridge.service @@ -97,20 +96,24 @@ ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data/habridge.confi [Install] WantedBy=multi-user.target ``` + Save the file in the editor by hitting CTL-X and then saying Y to update and save. Reload the system control config: ``` pi@raspberrypi:~ $ sudo systemctl daemon-reload ``` + To start the bridge: ``` pi@raspberrypi:~ $ sudo systemctl start habridge.service ``` + To start the service at boot, use the `enable` command: ``` pi@raspberrypi:~ $ sudo systemctl enable habridge.service ``` + To look at the log, the output goes into the system log at `/var/log/syslog': ``` pi@raspberrypi:~ $ tail -f /var/log/syslog From db192df2c6a698f6230c23fae28ba6c6bac2a432 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Fri, 26 Jan 2018 13:42:00 +0100 Subject: [PATCH 3/6] docs: add section how to run docker container --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 3e06989..e959073 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,43 @@ To look at the log, the output goes into the system log at `/var/log/syslog': pi@raspberrypi:~ $ tail -f /var/log/syslog ``` +### ha-bridge inside Docker container +Docker start offering official support for Raspbian operating system since autumn 2016. +Running services inside containers became to be a good alternative to normal installation method described before. + +Install Docker Community Edition (CE) on Raspberry Pi +``` +pi@raspberrypi:~ $ curl -fsSL get.docker.com -o get-docker.sh +pi@raspberrypi:~ $ sudo sh get-docker.sh +``` + +For every architecture there is a specialized ha-bridge Docker image available. +Please use the suitable image from the following list. + +* Generic x86 / x86_64 system: [aptalca/home-automation-bridge](https://hub.docker.com/r/aptalca/home-automation-bridge) +* Raspberry Pi 1 (ARM): [habridge/ha-bridge-raspberry-pi](https://hub.docker.com/r/habridge/ha-bridge-raspberry-pi) +* Raspberry Pi 2 (ARM): [habridge/ha-bridge-raspberry-pi2](https://hub.docker.com/r/habridge/ha-bridge-raspberry-pi2) +* Raspberry Pi 3 (ARM): [habridge/ha-bridge-raspberrypi3](https://hub.docker.com/r/habridge/ha-bridge-raspberrypi3) + +Run the latest version of ha-bridge Docker container on Raspberry Pi 3: +``` +pi@raspberrypi:~ $ docker pull habridge/ha-bridge-raspberrypi3 +pi@raspberrypi:~ $ docker run \ + --name habridge \ + --rm \ + --detach \ + --net=host \ + --volume=$PWD:/habridge/data \ + --volume=/etc/localtime:/etc/localtime:ro \ + --volume=/etc/timezone:/etc/timezone:ro \ + habridge/ha-bridge-raspberrypi3 +``` + +To halt the ha-bridge Docker container use the `stop` command: +``` +pi@raspberrypi:~ $ docker stop habridge +``` + ## Run ha-bridge alongside web server already on port 80 These examples will help you proxy your current webserver requests to the ha-bridge running on a different port, such as 8080. From 21fdaf4545d123b52812702e1e9765351e178d13 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Fri, 26 Jan 2018 13:42:49 +0100 Subject: [PATCH 4/6] docs: remove trailing whitespaces --- README.md | 86 +++++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index e959073..9dca460 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ These examples will help you proxy your current webserver requests to the ha-bri Reverse proxy with Apache on Ubuntu linux: -Enable the required Apache modules: +Enable the required Apache modules: `a2enmod proxy proxy_http headers` @@ -187,14 +187,14 @@ Added the following lines to my Apache config file “000-default” ``` -Restart apache for the changes to take effect. +Restart apache for the changes to take effect. `service apache2 restart` ### lighthttpd Example ``` server.modules += ( "mod_proxy" ) -proxy.server = ( +proxy.server = ( "/api" => ( ( "host" => "127.0.0.1", @@ -267,13 +267,13 @@ The default location for the configuration file to contain the settings for the #### Device DB Path and File The default location for the db to contain the devices as they are added is "data/devices.db". If you would like a different filename or directory, specify `/ explicitly. #### UPNP IP Address -The server defaults to the first available address on the host if this is not given. This default may NOT be the correct IP that is your public IP for your host on the network. It is best to set this parameter to not have discovery issues. Replace this value with the server ipv4 address you would like to use as the address that any upnp device will call after discovery. +The server defaults to the first available address on the host if this is not given. This default may NOT be the correct IP that is your public IP for your host on the network. It is best to set this parameter to not have discovery issues. Replace this value with the server ipv4 address you would like to use as the address that any upnp device will call after discovery. #### Use UPNP Address Interface The server tries to bind to all interfaces to respond to UPNP request. Setting this to `true` will make the binding to the interface that has the `UPNP IP Address`. The default is to be all interfaces which is set as false. #### Use Rooms for Alexa This setting controls rooms for Alexa. If it is set to true, any device ID abaove 10000 is treated as a special group. The default is set as false. #### Web Server IP Address -The server defaults to all interfaces on the machine (0.0.0.0). Replace this value with the server ipv4 address you would like to use as the address that will bind to a specific ip address on an interface if you would like. This is only necessary if you want to isolate how access is handled to the web UI. +The server defaults to all interfaces on the machine (0.0.0.0). Replace this value with the server ipv4 address you would like to use as the address that will bind to a specific ip address on an interface if you would like. This is only necessary if you want to isolate how access is handled to the web UI. #### Web Server Port The server defaults to running on port 80. To override what the default is, specify a different number. ATTENTION: If you want to use any of the apps made for the Hue to control this bridge, you should keep this port set to 80. #### UPNP Response Port @@ -289,13 +289,13 @@ Provide IP Addresses of your Hue Bridges that you want to proxy through the brid Don't forget - You will need to push the link button when you got to the Hue Tab the first time after the process comes up. (The user name is not persistent when the process comes up.) #### HAL Names and IP Addresses -Provide IP Addresses of your HAL Systems that you want to utilize with the bridge. Also, give a meaningful name to each one so it is easy to decipher in the helper tab. When these names and IP's are given, the bridge will be able to control the devices or scenes by the call it receives and send it to the target HAL and device/scene you configure. -#### MQTT Client IDs and IP Addresses +Provide IP Addresses of your HAL Systems that you want to utilize with the bridge. Also, give a meaningful name to each one so it is easy to decipher in the helper tab. When these names and IP's are given, the bridge will be able to control the devices or scenes by the call it receives and send it to the target HAL and device/scene you configure. +#### MQTT Client IDs and IP Addresses Provide Client ID and IP Addresses and ports of your MQTT Brokers that you want to utilize with the bridge. Also, you can provide the username and password if you have secured your MQTT broker which is optional. When these Client ID and IP's are given, the bridge will be able to publish MQTT messages by the call it receives and send it to the target MQTT Broker you configure. The MQTT Messages Tab will become available to help you build messages. #### Home Assistant Names and IP Addresses -Provide IP Addresses and ports of your Home Assistant that you want to utilize with the bridge. Also, give a meaningful name to each one so it is easy to decipher in the helper tab. When these names and IP's are given, the bridge will be able to control the devices or scenes by the call it receives and send it to the target Home Assistant and device/scene you configure. +Provide IP Addresses and ports of your Home Assistant that you want to utilize with the bridge. Also, give a meaningful name to each one so it is easy to decipher in the helper tab. When these names and IP's are given, the bridge will be able to control the devices or scenes by the call it receives and send it to the target Home Assistant and device/scene you configure. #### Domoticz Names and IP Addresses -Provide IP Addresses of your Domoticz Systems that you want to utilize with the bridge. Also, give a meaningful name to each one so it is easy to decipher in the helper tab. When these names and IP's are given, the bridge will be able to control the devices or scenes by the call it receives and send it to the target Domoticz and device/scene you configure. +Provide IP Addresses of your Domoticz Systems that you want to utilize with the bridge. Also, give a meaningful name to each one so it is easy to decipher in the helper tab. When these names and IP's are given, the bridge will be able to control the devices or scenes by the call it receives and send it to the target Domoticz and device/scene you configure. #### Somfy Tahoma Names and IP Addresses Provide user name and password used to login to www.tahomalink.com. This needs to be provided if you're using the Somfy Tahoma features (for connecting to IO Homecontrol used by Velux among others). There is no need to give any IP address or host information as this contacts your cloud account. *Note:* you have to 'turn on' a window to open it, and 'turn off' to close. #### Nest Username @@ -323,13 +323,13 @@ At the bottom of the screen is the "Bridge Settings Backup" which can be accesse ### The Logs Tab This screen displays the last 512 or number of rows defined in the config screen of the log so you don't have to go to the output of your process. The `Update Log` button refreshes the log as this screen does not auto refresh. FYI, when the trace upnp setting is turned on in the configuration, the messages will show here. -The bottom part of the Logs Screen has configuration to change the logging levels as it is running. The ROOT is the basic setting and will turn on only top level logging. To set logging at a lower level, select the `Show All Loggers` checkbox and then you can set the explicit level on each of the processes components. The most helpful logger would be setting DEBUG for com.bwssystems.HABridge.hue.HueMulator component. Changing this and then selecting the `Update Log Levels` button applies the new log settings. +The bottom part of the Logs Screen has configuration to change the logging levels as it is running. The ROOT is the basic setting and will turn on only top level logging. To set logging at a lower level, select the `Show All Loggers` checkbox and then you can set the explicit level on each of the processes components. The most helpful logger would be setting DEBUG for com.bwssystems.HABridge.hue.HueMulator component. Changing this and then selecting the `Update Log Levels` button applies the new log settings. ### Bridge Device Additions You must configure devices before you will have anything for the Echo or other controller that is connected to the ha-bridge to receive. #### Helpers The easy way to get devices configured is with the use of the helpers for the Vera or Harmony, Nest, Hue and others to create devices that the bridge will present. -For the Helpers, each item being presented from the target system has a button such as `Build Item`, `Build A Button` or specific tasks such as `Temp` for thermostats that is used to create the specific device parameters. The build action buttons will put you into the edit screen. The next thing to check is the name for the bridge device that it is something that makes sense especially if you using the ha-bridge with an Echo or Google Home as this is what the Echo or Google Home will interpret as the device you want. Also, you can go back to any helper tab and click a build action button to add another item for a multi-command. After you are done in the edit tab, click the `Add Bridge Device` to finish that selection setup. +For the Helpers, each item being presented from the target system has a button such as `Build Item`, `Build A Button` or specific tasks such as `Temp` for thermostats that is used to create the specific device parameters. The build action buttons will put you into the edit screen. The next thing to check is the name for the bridge device that it is something that makes sense especially if you using the ha-bridge with an Echo or Google Home as this is what the Echo or Google Home will interpret as the device you want. Also, you can go back to any helper tab and click a build action button to add another item for a multi-command. After you are done in the edit tab, click the `Add Bridge Device` to finish that selection setup. The helper tabs will also show you what you have already configured for that target type. Click on the `+` and you will see them and be able to delete them. #### The Add/Edit Tab @@ -366,13 +366,13 @@ Example from device.db: [{"item":,"type":""."count":X."delay":X."filterIPs":""."httpVerb":"","httpBody":"","httpHeaders":[{"name":"header name","value":"header value"},{"name":"another header","value":"another value"}],"contentType":""},{"item":,"type":""}] ``` -The format of the example is in JSON where the JSON tags equate to the UI labels of the On Items/Dim Items/Off Items. i.e.: JSON item = UI Target Item, JSON type = UI Type, etc... +The format of the example is in JSON where the JSON tags equate to the UI labels of the On Items/Dim Items/Off Items. i.e.: JSON item = UI Target Item, JSON type = UI Type, etc... The Add/Edit tab will show you the fields to fill in for the above in a form, when you have completed putting in the things you want, make sure to hit the `Add` button at the right. - + The format of the item can be the default HTTP request which executes the URLs formatted as `http://` as a GET. Other options to this are to select the HTTP Verb and add the data type and add a body that is passed with the request. Secure https is supported as well, just use `https://`. When using POST and PUT, you have the ability to specify the body that will be sent with the request as well as the application type for the http call. -The valid device types are: "custom", "veraDevice", "veraScene", "harmonyActivity", "harmonyButton", "nestHomeAway", "nestThermoSet", "hueDevice", "halDevice", +The valid device types are: "custom", "veraDevice", "veraScene", "harmonyActivity", "harmonyButton", "nestHomeAway", "nestThermoSet", "hueDevice", "halDevice", "halButton", "halHome", "halThermoSet", "mqttMessage", "cmdDevice", "hassDevice", "homewizardDevice", "tcpDevice", "udpDevice", "httpDevice", "domoticzDevice", "somfyDevice" Filter Ip example: @@ -507,7 +507,7 @@ The Google Assistant can also group lights into rooms as described in the main [ Here is the table of items to use to tell Google what you want to do. Note that either "OK Google" or "Hey Google" can be used as a trigger. - + To do this: | Say "Hey Google", then... ------------|-------------------------- To turn on/off a light | "Turn on " @@ -515,7 +515,7 @@ Dim a light | "Dim the " Brighten a light | "Brighten the " Set a light brightness to a certain percentage | "Set to 50%" Dim/Brighten lights by a certain percentage | "Dim/Brighten by 50%" -Turn on/off all lights in room | "Turn on/off lights in " +Turn on/off all lights in room | "Turn on/off lights in " Turn on/off all lights | "Turn on/off all of the lights" To see what Home thinks you said, you can ask "Hey Google, What did I say?" or check the history in the app. @@ -530,7 +530,7 @@ This section will describe the REST API available for configuration. The REST bo ``` The body should be all in one string and not separated by returns, tabs or spaces. FYI, GET items do not require a body element. If you would like to see example return of json data for full Harmony Hub configuration if configured, which includes activities and devices, take a look at the resource file config.data. If you are interested in how the json data looks for the HA bridge configuration, after creating a device, look at the data directory for the device.db. These calls can be accomplished with a REST tool using the following URLs and HTTP Verb types: -### Add a device +### Add a device Add a new device to the HA Bridge configuration. There is a basic examples and then three alternate examples for the add. Please note that dimming is supported as well as custom value based on the dimming number given from the echo. This is under the Dimming and Value example. ``` POST http://host/api/devices @@ -589,7 +589,7 @@ See the echo's documentation for the dimming phrase. #### POST/PUT Support Example ``` This will allow control of any other application that may need more then GET. You can also use the dimming and value control commands within the URLs as well. -e.g: +e.g: { "name": "test device", "deviceType": "custom", @@ -642,8 +642,8 @@ contentBodyOff | string | This is the content body that you would like to send w "offUrl" : [{"item":"http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=41","type":"veraDevice"}] } ``` -### Update a Device -Update an existing device using its ID that was given when the device was created and the update could contain any of the fields that are used and shown in the previous examples when adding a device. +### Update a Device +Update an existing device using its ID that was given when the device was created and the update could contain any of the fields that are used and shown in the previous examples when adding a device. **Note: You must supply all fields of the device in return as this is a replacement update for the given id.** ``` @@ -686,8 +686,8 @@ contentBodyOff | string | This is the content body that you would like to send w "offUrl" : [{"item":"http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=41","type":"veraDevice"}] } ``` -### Get All Devices -Get all devices saved in the HA bridge configuration. +### Get All Devices +Get all devices saved in the HA bridge configuration. ``` GET http://host:port/api/devices ``` @@ -709,8 +709,8 @@ Individual entries are the same as a single device but in json list format. "offUrl" : [{"item":"http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=41","type":"veraDevice"}] }] ``` -### Get a Specific Device -Get a device by ID assigned from creation and saved in the HA bridge configuration. +### Get a Specific Device +Get a device by ID assigned from creation and saved in the HA bridge configuration. ``` GET http://host:port/api/devices/ ``` @@ -725,15 +725,15 @@ The response is the same layout as defined in the add device response. "offUrl" : [{"item":"http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=41","type":"veraDevice"}] } ``` -### Delete a Specific Device -Delete a device by ID assigned from creation and saved in the HA bridge configuration. +### Delete a Specific Device +Delete a device by ID assigned from creation and saved in the HA bridge configuration. ``` DELETE http://host:port/api/devices/ ``` #### Response This call returns a null json "{}". -### Get HA Bridge Version -Get current version of the HA bridge software. +### Get HA Bridge Version +Get current version of the HA bridge software. ``` GET http://host:port/system/habridge/version ``` @@ -744,7 +744,7 @@ version | string | The version returned by the software. ``` {"version":"1.0.7"} ``` -### Get Vera Devices +### Get Vera Devices Get the list of devices available from the Vera, VeraLite or VeraEdge if configured. Please refer to the Luup Sdata Structure for the explanation of the devices list returned. ``` GET http://host:port/api/devices/vera/devices @@ -795,7 +795,7 @@ comment | string | Comment configured with device. Not always present. "veraddress":"192.168.1.2" }] ``` -### Get Vera Scenes +### Get Vera Scenes Get the list of scenes available from the Vera, VeraLite or VeraEdge if configured. Please refer to the Luup Sdata Structure for the explanation of the scenes list returned. ``` GET http://host:port/api/devices/vera/scenes @@ -803,7 +803,7 @@ GET http://host:port/api/devices/vera/scenes #### Response Name | Type | Description -----|-------|------------- -active | string | 1 if the scene is active, 0 otherwise. +active | string | 1 if the scene is active, 0 otherwise. name | string | The name of the Vera scene. id | string | Vera id for accessing scene. This is used in calls to the vera url for control. room | string | Room name assigned to scene. @@ -826,7 +826,7 @@ room | string | Room name assigned to scene. }] ``` ### Get Harmony Activities -Get the list of activities available from the Harmony Hub if configured. +Get the list of activities available from the Harmony Hub if configured. ``` GET http://host:port/api/devices/harmony/activities ``` @@ -839,13 +839,13 @@ Name | Type | Description -----|-------|------------- hub | string | The name of the given target hub. activity:label | string | The name of the Harmony activity. -activity:id | integer | The id of the Harmony activity. +activity:id | integer | The id of the Harmony activity. #### Harmony activities data example ``` [{"hub":"ChicagoanHub","activity":{"label":"Watch TV","suggestedDisplay":"Default","id":15823996,"activityTypeDisplayName":"Default","controlGroup":[{"name":"NumericBasic","function":[{"name":"NumberEnter","label":"Number Enter","action":"{\"command\":\"Enter\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Hyphen","label":"-","action":"{\"command\":\"-\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number0","label":"0","action":"{\"command\":\"0\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number1","label":"1","action":"{\"command\":\"1\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number2","label":"2","action":"{\"command\":\"2\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number3","label":"3","action":"{\"command\":\"3\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number4","label":"4","action":"{\"command\":\"4\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number5","label":"5","action":"{\"command\":\"5\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number6","label":"6","action":"{\"command\":\"6\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number7","label":"7","action":"{\"command\":\"7\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number8","label":"8","action":"{\"command\":\"8\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number9","label":"9","action":"{\"command\":\"9\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"Volume","function":[{"name":"Mute","label":"Mute","action":"{\"command\":\"Mute\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"},{"name":"VolumeDown","label":"Volume Down","action":"{\"command\":\"VolumeDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"},{"name":"VolumeUp","label":"Volume Up","action":"{\"command\":\"VolumeUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"}]},{"name":"Channel","function":[{"name":"PrevChannel","label":"Prev Channel","action":"{\"command\":\"Last\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"ChannelDown","label":"Channel Down","action":"{\"command\":\"ChannelDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"ChannelUp","label":"Channel Up","action":"{\"command\":\"ChannelUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationBasic","function":[{"name":"DirectionDown","label":"Direction Down","action":"{\"command\":\"DirectionDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"DirectionLeft","label":"Direction Left","action":"{\"command\":\"DirectionLeft\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"DirectionRight","label":"Direction Right","action":"{\"command\":\"DirectionRight\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"DirectionUp","label":"Direction Up","action":"{\"command\":\"DirectionUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Select","label":"Select","action":"{\"command\":\"Select\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TransportBasic","function":[{"name":"Play","label":"Play","action":"{\"command\":\"Play\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Rewind","label":"Rewind","action":"{\"command\":\"Rewind\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Pause","label":"Pause","action":"{\"command\":\"Pause\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"FastForward","label":"Fast Forward","action":"{\"command\":\"FastForward\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TransportRecording","function":[{"name":"Record","label":"Record","action":"{\"command\":\"Record\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TransportExtended","function":[{"name":"FrameAdvance","label":"Frame Advance","action":"{\"command\":\"Slow\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"SkipBackward","label":"Skip Backward","action":"{\"command\":\"Replay\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"SkipForward","label":"Skip Forward","action":"{\"command\":\"Advance\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationDVD","function":[{"name":"Back","label":"Back","action":"{\"command\":\"Back\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationDSTB","function":[{"name":"C","label":"C","action":"{\"command\":\"C\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"B","label":"B","action":"{\"command\":\"B\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"D","label":"D","action":"{\"command\":\"D\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"A","label":"A","action":"{\"command\":\"A\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"List","label":"List","action":"{\"command\":\"List\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Live","label":"Live","action":"{\"command\":\"LiveTv\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TiVo","function":[{"name":"ThumbsDown","label":"Thumbs Down","action":"{\"command\":\"ThumbsDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"ThumbsUp","label":"Thumbs Up","action":"{\"command\":\"ThumbsUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"TiVo","label":"TiVo","action":"{\"command\":\"TiVo\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationExtended","function":[{"name":"Guide","label":"Guide","action":"{\"command\":\"Guide\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Info","label":"Info","action":"{\"command\":\"Info\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Clear","label":"Backspace","action":"{\"command\":\"Clear\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"ColoredButtons","function":[{"name":"Green","label":"Green","action":"{\"command\":\"Green\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Red","label":"Red","action":"{\"command\":\"Red\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Blue","label":"Blue","action":"{\"command\":\"Blue\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Yellow","label":"Yellow","action":"{\"command\":\"Yellow\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]}],"activityOrder":0,"tuningDefault":true,"fixit":{"29671749":{"id":"29671749","power":"ON","input":"HDMI 4","alwaysOn":false,"relativePower":true},"29695418":{"id":"29695418","power":"OFF","alwaysOn":false,"relativePower":true},"29671742":{"id":"29671742","power":"ON","input":"","alwaysOn":false,"relativePower":false},"29671764":{"id":"29671764","alwaysOn":false,"relativePower":false},"29695438":{"id":"29695438","power":"OFF","alwaysOn":false,"relativePower":true},"29695467":{"id":"29695467","alwaysOn":false,"relativePower":false},"29695485":{"id":"29695485","alwaysOn":false,"relativePower":false}},"type":"VirtualTelevisionN","icon":"userdata: 0x4454e0","baseImageUri":"https://rcbu-test-ssl-amr.s3.amazonaws.com/"}},{"hub":"ChicagoanHub","activity":{"label":"PowerOff","suggestedDisplay":"Default","id":-1,"activityTypeDisplayName":"Default","controlGroup":[],"tuningDefault":false,"fixit":{"29671749":{"id":"29671749","power":"OFF","alwaysOn":false,"relativePower":true},"29695418":{"id":"29695418","power":"OFF","alwaysOn":false,"relativePower":true},"29671742":{"id":"29671742","power":"OFF","alwaysOn":false,"relativePower":false},"29671764":{"id":"29671764","alwaysOn":false,"relativePower":false},"29695438":{"id":"29695438","power":"OFF","alwaysOn":false,"relativePower":true},"29695467":{"id":"29695467","alwaysOn":false,"relativePower":false},"29695485":{"id":"29695485","alwaysOn":false,"relativePower":false}},"type":"PowerOff","icon":"Default"}},{"hub":"ChicagoanHub","activity":{"label":"Watch a Movie","suggestedDisplay":"Default","id":15839533,"activityTypeDisplayName":"Default","controlGroup":[{"name":"NumericBasic","function":[{"name":"Number0","label":"0","action":"{\"command\":\"0\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number1","label":"1","action":"{\"command\":\"1\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number2","label":"2","action":"{\"command\":\"2\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number3","label":"3","action":"{\"command\":\"3\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number4","label":"4","action":"{\"command\":\"4\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number5","label":"5","action":"{\"command\":\"5\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number6","label":"6","action":"{\"command\":\"6\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number7","label":"7","action":"{\"command\":\"7\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number8","label":"8","action":"{\"command\":\"8\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Number9","label":"9","action":"{\"command\":\"9\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Clear","label":"Clear","action":"{\"command\":\"Clear\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"Volume","function":[{"name":"Mute","label":"Mute","action":"{\"command\":\"Mute\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"},{"name":"VolumeDown","label":"Volume Down","action":"{\"command\":\"VolumeDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"},{"name":"VolumeUp","label":"Volume Up","action":"{\"command\":\"VolumeUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"}]},{"name":"NavigationBasic","function":[{"name":"DirectionDown","label":"Direction Down","action":"{\"command\":\"DirectionDown\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"DirectionLeft","label":"Direction Left","action":"{\"command\":\"DirectionLeft\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"DirectionRight","label":"Direction Right","action":"{\"command\":\"DirectionRight\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"DirectionUp","label":"Direction Up","action":"{\"command\":\"DirectionUp\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Select","label":"Select","action":"{\"command\":\"Ok\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"TransportBasic","function":[{"name":"Stop","label":"Stop","action":"{\"command\":\"Stop\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Play","label":"Play","action":"{\"command\":\"Play\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Rewind","label":"Rewind","action":"{\"command\":\"Rewind\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Eject","label":"Eject","action":"{\"command\":\"Eject\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Pause","label":"Pause","action":"{\"command\":\"Pause\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"FastForward","label":"Fast Forward","action":"{\"command\":\"FastForward\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"TransportExtended","function":[{"name":"FrameAdvance","label":"Frame Advance","action":"{\"command\":\"Step\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"SkipBackward","label":"Skip Backward","action":"{\"command\":\"SkipBack\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"SkipForward","label":"Skip Forward","action":"{\"command\":\"SkipForward\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"NavigationDVD","function":[{"name":"Return","label":"Return","action":"{\"command\":\"Return\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"TopMenu","label":"Top Menu","action":"{\"command\":\"TopMenu\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Menu","label":"Menu","action":"{\"command\":\"Menu\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Subtitle","label":"Subtitle","action":"{\"command\":\"Subtitle\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"PlayMode","function":[{"name":"Repeat","label":"Repeat","action":"{\"command\":\"Repeat\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"Program","function":[{"name":"Program","label":"Program","action":"{\"command\":\"Program\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Bookmark","label":"Bookmark","action":"{\"command\":\"Bookmark\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"GameType3","function":[{"name":"Home","label":"Home","action":"{\"command\":\"Home\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"NavigationExtended","function":[{"name":"Clear","label":"Backspace","action":"{\"command\":\"Clear\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]},{"name":"ColoredButtons","function":[{"name":"Green","label":"Green","action":"{\"command\":\"Green\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Red","label":"Red","action":"{\"command\":\"Red\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Blue","label":"Blue","action":"{\"command\":\"Blue\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"},{"name":"Yellow","label":"Yellow","action":"{\"command\":\"Yellow\",\"type\":\"IRCommand\",\"deviceId\":\"29695418\"}"}]}],"activityOrder":3,"tuningDefault":false,"fixit":{"29671749":{"id":"29671749","power":"ON","input":"HDMI 2","alwaysOn":false,"relativePower":true},"29695418":{"id":"29695418","power":"ON","alwaysOn":false,"relativePower":true},"29671742":{"id":"29671742","power":"ON","input":"","alwaysOn":false,"relativePower":false},"29671764":{"id":"29671764","alwaysOn":false,"relativePower":false},"29695438":{"id":"29695438","power":"OFF","alwaysOn":false,"relativePower":true},"29695467":{"id":"29695467","alwaysOn":false,"relativePower":false},"29695485":{"id":"29695485","alwaysOn":false,"relativePower":false}},"type":"VirtualDvd","icon":"userdata: 0x4454e0","baseImageUri":"https://rcbu-test-ssl-amr.s3.amazonaws.com/"}}] ``` ### Get Harmony Devices -Get the list of devices available from the Harmony Hub if configured. +Get the list of devices available from the Harmony Hub if configured. ``` GET http://host:port/api/devices/harmony/devices ``` @@ -857,16 +857,16 @@ Main device object Name | Type | Description -----|-------|------------- hub | string | The name of the given target hub. -device:id | integer | The id of the Harmony device. +device:id | integer | The id of the Harmony device. device:label | string | The name of the Harmony device. -device:controlGroup | object | The structure that contains buttons grouped by control areas. +device:controlGroup | object | The structure that contains buttons grouped by control areas. Control Group object Name | Type | Description -----|-------|------------- name | string | The name of a device control area. -function | object | The structure that contains buttons grouped by function. +function | object | The structure that contains buttons grouped by function. Function object @@ -891,13 +891,13 @@ Name | Type | Description -----|-------|------------- hub | string | The name of the given target hub. activity:label | string | The name of the Harmony activity. -activity:id | integer | The id of the Harmony activity. +activity:id | integer | The id of the Harmony activity. #### Harmony activity data example ``` [{"hub":"ChicagoanHub","activity":{"label":"Watch TV","suggestedDisplay":"Default","id":15823996,"activityTypeDisplayName":"Default","controlGroup":[{"name":"NumericBasic","function":[{"name":"NumberEnter","label":"Number Enter","action":"{\"command\":\"Enter\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Hyphen","label":"-","action":"{\"command\":\"-\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number0","label":"0","action":"{\"command\":\"0\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number1","label":"1","action":"{\"command\":\"1\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number2","label":"2","action":"{\"command\":\"2\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number3","label":"3","action":"{\"command\":\"3\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number4","label":"4","action":"{\"command\":\"4\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number5","label":"5","action":"{\"command\":\"5\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number6","label":"6","action":"{\"command\":\"6\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number7","label":"7","action":"{\"command\":\"7\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number8","label":"8","action":"{\"command\":\"8\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Number9","label":"9","action":"{\"command\":\"9\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"Volume","function":[{"name":"Mute","label":"Mute","action":"{\"command\":\"Mute\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"},{"name":"VolumeDown","label":"Volume Down","action":"{\"command\":\"VolumeDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"},{"name":"VolumeUp","label":"Volume Up","action":"{\"command\":\"VolumeUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671749\"}"}]},{"name":"Channel","function":[{"name":"PrevChannel","label":"Prev Channel","action":"{\"command\":\"Last\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"ChannelDown","label":"Channel Down","action":"{\"command\":\"ChannelDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"ChannelUp","label":"Channel Up","action":"{\"command\":\"ChannelUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationBasic","function":[{"name":"DirectionDown","label":"Direction Down","action":"{\"command\":\"DirectionDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"DirectionLeft","label":"Direction Left","action":"{\"command\":\"DirectionLeft\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"DirectionRight","label":"Direction Right","action":"{\"command\":\"DirectionRight\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"DirectionUp","label":"Direction Up","action":"{\"command\":\"DirectionUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Select","label":"Select","action":"{\"command\":\"Select\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TransportBasic","function":[{"name":"Play","label":"Play","action":"{\"command\":\"Play\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Rewind","label":"Rewind","action":"{\"command\":\"Rewind\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Pause","label":"Pause","action":"{\"command\":\"Pause\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"FastForward","label":"Fast Forward","action":"{\"command\":\"FastForward\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TransportRecording","function":[{"name":"Record","label":"Record","action":"{\"command\":\"Record\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TransportExtended","function":[{"name":"FrameAdvance","label":"Frame Advance","action":"{\"command\":\"Slow\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"SkipBackward","label":"Skip Backward","action":"{\"command\":\"Replay\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"SkipForward","label":"Skip Forward","action":"{\"command\":\"Advance\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationDVD","function":[{"name":"Back","label":"Back","action":"{\"command\":\"Back\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationDSTB","function":[{"name":"C","label":"C","action":"{\"command\":\"C\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"B","label":"B","action":"{\"command\":\"B\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"D","label":"D","action":"{\"command\":\"D\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"A","label":"A","action":"{\"command\":\"A\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"List","label":"List","action":"{\"command\":\"List\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Live","label":"Live","action":"{\"command\":\"LiveTv\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"TiVo","function":[{"name":"ThumbsDown","label":"Thumbs Down","action":"{\"command\":\"ThumbsDown\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"ThumbsUp","label":"Thumbs Up","action":"{\"command\":\"ThumbsUp\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"TiVo","label":"TiVo","action":"{\"command\":\"TiVo\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"NavigationExtended","function":[{"name":"Guide","label":"Guide","action":"{\"command\":\"Guide\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Info","label":"Info","action":"{\"command\":\"Info\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Clear","label":"Backspace","action":"{\"command\":\"Clear\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]},{"name":"ColoredButtons","function":[{"name":"Green","label":"Green","action":"{\"command\":\"Green\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Red","label":"Red","action":"{\"command\":\"Red\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Blue","label":"Blue","action":"{\"command\":\"Blue\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"},{"name":"Yellow","label":"Yellow","action":"{\"command\":\"Yellow\",\"type\":\"IRCommand\",\"deviceId\":\"29671764\"}"}]}],"activityOrder":0,"tuningDefault":true,"fixit":{"29671749":{"id":"29671749","power":"ON","input":"HDMI 4","alwaysOn":false,"relativePower":true},"29695418":{"id":"29695418","power":"OFF","alwaysOn":false,"relativePower":true},"29671742":{"id":"29671742","power":"ON","input":"","alwaysOn":false,"relativePower":false},"29671764":{"id":"29671764","alwaysOn":false,"relativePower":false},"29695438":{"id":"29695438","power":"OFF","alwaysOn":false,"relativePower":true},"29695467":{"id":"29695467","alwaysOn":false,"relativePower":false},"29695485":{"id":"29695485","alwaysOn":false,"relativePower":false}},"type":"VirtualTelevisionN","icon":"userdata: 0x4454e0","baseImageUri":"https://rcbu-test-ssl-amr.s3.amazonaws.com/"},{"label":"PowerOff","suggestedDisplay":"Default","id":-1,"activityTypeDisplayName":"Default","controlGroup":[],"tuningDefault":false,"fixit":{"29671749":{"id":"29671749","power":"OFF","alwaysOn":false,"relativePower":true},"29695418":{"id":"29695418","power":"OFF","alwaysOn":false,"relativePower":true},"29671742":{"id":"29671742","power":"OFF","alwaysOn":false,"relativePower":false},"29671764":{"id":"29671764","alwaysOn":false,"relativePower":false},"29695438":{"id":"29695438","power":"OFF","alwaysOn":false,"relativePower":true},"29695467":{"id":"29695467","alwaysOn":false,"relativePower":false},"29695485":{"id":"29695485","alwaysOn":false,"relativePower":false}},"type":"PowerOff","icon":"Default"}}] ``` ### Get Nest Items -Get the list of Nest Home Structures and Thermostats available for a Nest account if configured. +Get the list of Nest Home Structures and Thermostats available for a Nest account if configured. ``` GET http://host:port/api/devices/nest/items ``` @@ -909,14 +909,14 @@ Name | Type | Description -----|-------|------------- name | string | The name of the Nest item. id | string | The id of the Nest item. -type | string | The type of nest item returned. i.e.: Home or Thermostat +type | string | The type of nest item returned. i.e.: Home or Thermostat location | string | Location of the device. For Home type it is the physical location. For the thermostat it is the Room Location and Home name. #### Nest items data example ``` [{"name":"TestHouse","id":"b999fcb0-9dbb-11e5-acf5-22000aba84ca","type":"Home","location":"Scranton, OH"},{"name":"Bedroom(3658)","id":"fake7890F3EC3658","type":"Thermostat","location":"Bedroom - TestHouse"},{"name":"Basement(A594)","id":"fake7890E4ABA594","type":"Thermostat","location":"Basement - TestHouse"}] ``` ### Get Hue Items -Get the list of HUE device descriptors if the HUE pass thru devices are configured. +Get the list of HUE device descriptors if the HUE pass thru devices are configured. ``` GET http://host:port/api/devices/hue/devices ``` @@ -945,7 +945,7 @@ Gets a list of all lights that have been discovered by the bridge. GET http://host:port/api//lights ``` #### Response -Returns a list of all lights in the system. +Returns a list of all lights in the system. If there are no lights in the system then the bridge will return an empty object, {}. ``` @@ -1216,7 +1216,7 @@ hue-bridgeid: 001E06FFFE123456 ST: urn:schemas-upnp-org:device:basic:1 USN: uuid:2f402f80-da50-11e1-9b23-001e06123456 ``` - + Note that `192.168.1.1` and `12345` are replaced with the actual IP address and last 6 digits of the MAC address, respectively. From b8acb4a52c25717d52d6736476f2d2f6c4f95054 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Sat, 27 Jan 2018 13:07:37 +0100 Subject: [PATCH 5/6] feat: add minus in ha-bridge names for consistency --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9dca460..2bcc3fe 100644 --- a/README.md +++ b/README.md @@ -68,18 +68,18 @@ java -jar ha-bridge-5.1.0.jar Next gen Linux systems (this includes the Raspberry Pi), use systemd to run and manage services. Here is a link on how to use systemd: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units -Create the directory and make sure that ha-bridge-5.1.0.jar is in your /home/pi/habridge directory. +Create the directory and make sure that ha-bridge-5.1.0.jar is in your /home/pi/ha-bridge directory. ``` -pi@raspberrypi:~ $ mkdir habridge -pi@raspberrypi:~ $ cd habridge +pi@raspberrypi:~ $ mkdir ha-bridge +pi@raspberrypi:~ $ cd ha-bridge -pi@raspberrypi:~/habridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.1.0/ha-bridge-5.1.0.jar +pi@raspberrypi:~/ha-bridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.1.0/ha-bridge-5.1.0.jar ``` -Create the habridge.service unit file: +Create the ha-bridge.service unit file: ``` pi@raspberrypi:~ $ cd /etc/systemd/system -pi@raspberrypi:~ $ sudo nano habridge.service +pi@raspberrypi:~ $ sudo nano ha-bridge.service ``` Copy the text below into the editor nano. ``` @@ -90,8 +90,8 @@ After=network.target [Service] Type=simple -WorkingDirectory=/home/pi/habridge -ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-5.1.0.jar +WorkingDirectory=/home/pi/ha-bridge +ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/ha-bridge/data/habridge.config /home/pi/ha-bridge/ha-bridge-5.1.0.jar [Install] WantedBy=multi-user.target @@ -106,12 +106,12 @@ pi@raspberrypi:~ $ sudo systemctl daemon-reload To start the bridge: ``` -pi@raspberrypi:~ $ sudo systemctl start habridge.service +pi@raspberrypi:~ $ sudo systemctl start ha-bridge.service ``` To start the service at boot, use the `enable` command: ``` -pi@raspberrypi:~ $ sudo systemctl enable habridge.service +pi@raspberrypi:~ $ sudo systemctl enable ha-bridge.service ``` To look at the log, the output goes into the system log at `/var/log/syslog': @@ -141,11 +141,11 @@ Run the latest version of ha-bridge Docker container on Raspberry Pi 3: ``` pi@raspberrypi:~ $ docker pull habridge/ha-bridge-raspberrypi3 pi@raspberrypi:~ $ docker run \ - --name habridge \ + --name ha-bridge \ --rm \ --detach \ --net=host \ - --volume=$PWD:/habridge/data \ + --volume=$PWD:/ha-bridge/data \ --volume=/etc/localtime:/etc/localtime:ro \ --volume=/etc/timezone:/etc/timezone:ro \ habridge/ha-bridge-raspberrypi3 @@ -153,7 +153,7 @@ pi@raspberrypi:~ $ docker run \ To halt the ha-bridge Docker container use the `stop` command: ``` -pi@raspberrypi:~ $ docker stop habridge +pi@raspberrypi:~ $ docker stop ha-bridge ``` ## Run ha-bridge alongside web server already on port 80 From dc28eb29846f986823c4a99e1206d30a66b3cd05 Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Mon, 29 Jan 2018 08:15:34 +0100 Subject: [PATCH 6/6] docs: refine Docker container usage instructions --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bcc3fe..36c5aa4 100644 --- a/README.md +++ b/README.md @@ -137,12 +137,13 @@ Please use the suitable image from the following list. * Raspberry Pi 2 (ARM): [habridge/ha-bridge-raspberry-pi2](https://hub.docker.com/r/habridge/ha-bridge-raspberry-pi2) * Raspberry Pi 3 (ARM): [habridge/ha-bridge-raspberrypi3](https://hub.docker.com/r/habridge/ha-bridge-raspberrypi3) -Run the latest version of ha-bridge Docker container on Raspberry Pi 3: +The following example explains how to run the latest version of ha-bridge Docker container on Raspberry Pi 3. ``` pi@raspberrypi:~ $ docker pull habridge/ha-bridge-raspberrypi3 pi@raspberrypi:~ $ docker run \ --name ha-bridge \ --rm \ + --init \ --detach \ --net=host \ --volume=$PWD:/ha-bridge/data \ @@ -151,11 +152,29 @@ pi@raspberrypi:~ $ docker run \ habridge/ha-bridge-raspberrypi3 ``` +To set additional arguments for ha-bridge just write them as arguments for docker run command. +``` +pi@raspberrypi:~ $ docker run \ + --name ha-bridge \ + --rm \ + --init \ + --detach \ + --net=host \ + --volume=$PWD:/ha-bridge/data \ + --volume=/etc/localtime:/etc/localtime:ro \ + --volume=/etc/timezone:/etc/timezone:ro \ + habridge/ha-bridge-raspberry-pi3 \ + -Dserver.port=8080 \ + -Dsecurity.key=secret +``` + To halt the ha-bridge Docker container use the `stop` command: ``` pi@raspberrypi:~ $ docker stop ha-bridge ``` +If you like to automate the deployment just use the Ansible role on https://github.com/escalate/ansible-ha-bridge-docker. + ## Run ha-bridge alongside web server already on port 80 These examples will help you proxy your current webserver requests to the ha-bridge running on a different port, such as 8080.