From 74206f52a95bf49399ccc09a1e107f74fcb493d7 Mon Sep 17 00:00:00 2001 From: Caprico85 Date: Mon, 27 Dec 2021 19:12:57 +0100 Subject: [PATCH] Remove old devices from Readme and add deprecation notice --- README.md | 675 +----------------------------------------------------- 1 file changed, 4 insertions(+), 671 deletions(-) diff --git a/README.md b/README.md index 4d42175a..32e6bd26 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ **Breaking change:** On upgrade to v0.1.0 you have to re-enter your credentials. See the [release notes](https://github.com/mikejac/node-red-contrib-google-smarthome/releases/tag/v0.1.0). +**Deprecation note:** As of v0.2.0 all device nodes except the Google Device are deprecated and will be removed later. Please migrate to the Google Device node. ## Table of Contents - [Introduction](#introduction) @@ -10,33 +11,7 @@ - [Nodes in this package](#nodes-in-this-package) - [General Information](#general-information) - [Google Device node](#--google-device-node-a-general-node-supporting-all-google-device-types-and-all-google-device-traits) - - [Light On/Off](#--light-onoff-a-light-that-can-be-switched-on-and-off-only) - - [Dimmable Light](#--dimmable-light) - - [Color Temperature Light](#--color-temperature-light) - - [Color (HSV) Light](#--color-hsv-light) - - [Color (RGB) Light](#--color-rgb-light) - - [Color (RGB/Temp) Light](#--color-rgbtemp-light) - - [Camera](#--camera) - - [Audio/Video Receiver](#--audiovideo-receiver) - - [Remote Control](#--remote-control) - - [Set-Top Box](#--set-top-box) - - [Sound Bar](#--sound-bar) - - [Speaker](#--speaker) - - [Streaming Box](#--streaming-box) - - [Streaming Sound Bar](#--streaming-sound-bar) - - [Streaming Stick](#--streaming-stick) - - [Television](#--television) - - [Outlet](#--outlet) - - [Thermostat](#--thermostat) - - [Window](#--window) - - [Scene](#--scene) - - [Vacuum](#--vacuum) - - [Fan](#--fan) - - [Kitchen Hood](#--kitchen-hood) - - [Fireplace](#--fireplace) - - [Sensor](#--sensor) - - [Shutter](#--shutter) - - [Switch](#--switch) + - [Other device nodes](#--other-device-nodes) - [Management](#--management) - [The config node](#the-config-node) - [Sending spoken notifications](#sending-spoken-notifications) @@ -293,651 +268,9 @@ and the following Google [traits](https://developers.google.com/assistant/smarth Example flow: See the flow used for the automatic tests [here](test/sh/flows.json) -#### - Light On/Off (a light that can be switched on and off only) -`topic` can be `on`, `online` or something else. +#### Other device nodes -If `topic` is `on` then `payload` must be boolean and tells the state of the light. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the light. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells all the states of the light. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true - } - -#### - Dimmable Light -`topic` can be `on`, `online`, `brightness` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the light. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the light. - - msg.topic = 'online' - msg.payload = true - -If `topic` is `brightness` then `payload` must be a number and tells the brightness of the light. Range is 0 through 100. - - msg.topic = 'brightness' - msg.payload = 75 - -If `topic` is something else then `payload` must be an object and tells all the states of the light. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true, - brightness: 100 - } - -#### - Color Temperature Light -`topic` can be `on`, `online`, `brightness`, `temperature` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the light. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the light. - - msg.topic = 'online' - msg.payload = true - -If `topic` is `brightness` then `payload` must be a number and tells the brightness of the light. Range is 0 through 100. - - msg.topic = 'brightness' - msg.payload = 75 - -If `topic` is `temperature` then `payload` must be a number and tells the color temperature of the light. Range is 2000 through 6000. - - msg.topic = 'temperature' - msg.payload = 3000 - - -If `topic` is something else then `payload` must be an object and tells all the states of the light. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true, - brightness: 100, - temperature: 3000 - } - -Example flow: - - [{"id":"43870b89.3a30f4","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/lamp/power","qos":"2","datatype":"auto","broker":"","x":310,"y":1640,"wires":[["45ed43ce.a1c31c"]]},{"id":"e099c1c7.36ea5","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/lamp/set-power","qos":"","retain":"","broker":"","x":1260,"y":1640,"wires":[]},{"id":"45ed43ce.a1c31c","type":"change","z":"1fdba310.d04cad","name":"topic = on","rules":[{"t":"set","p":"topic","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":1640,"wires":[["d068a2c2.0e73a"]]},{"id":"295718c8.bc2448","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/lamp/brightness","qos":"2","datatype":"auto","broker":"","x":320,"y":1680,"wires":[["a82a5960.98e028"]]},{"id":"a82a5960.98e028","type":"change","z":"1fdba310.d04cad","name":"topic = brightness","rules":[{"t":"set","p":"topic","pt":"msg","to":"brightness","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1680,"wires":[["d068a2c2.0e73a"]]},{"id":"90c6be23.e6b76","type":"function","z":"1fdba310.d04cad","name":"Split","func":"return [\n { payload: msg.payload.on },\n { payload: msg.payload.brightness },\n { payload: msg.payload.temperature },\n];","outputs":3,"noerr":0,"initialize":"","finalize":"","x":1050,"y":1680,"wires":[["e099c1c7.36ea5"],["57b812df.521b7c"],["d5b88148.ecde9"]],"outputLabels":["on","brightness","temperature"]},{"id":"57b812df.521b7c","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/lamp/set-brightness","qos":"","retain":"","broker":"","x":1270,"y":1680,"wires":[]},{"id":"d068a2c2.0e73a","type":"google-light-temperature","z":"1fdba310.d04cad","client":"","name":"Example Colortemp Light","topic":"example-colortemp-light","passthru":false,"x":830,"y":1680,"wires":[["90c6be23.e6b76"]]},{"id":"e99a1c80.cbf9b","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/lamp/colortemp","qos":"2","datatype":"auto","broker":"","x":320,"y":1720,"wires":[["e2b08d53.e775"]]},{"id":"e2b08d53.e775","type":"change","z":"1fdba310.d04cad","name":"topic = temperature","rules":[{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1720,"wires":[["d068a2c2.0e73a"]]},{"id":"d5b88148.ecde9","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/lamp/set-brightness","qos":"","retain":"","broker":"","x":1270,"y":1720,"wires":[]}] - -#### - Color (HSV) Light -`topic` can be `on`, `online`, `brightness`, `hue`, `saturation`, `value` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the light. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the light. - - msg.topic = 'online' - msg.payload = true - -If `topic` is `brightness` then `payload` must be a number and tells the brightness of the light. Range is 0 through 100. - - msg.topic = 'brightness' - msg.payload = 75 - -If `topic` is `hue` then `payload` must be a number and tells the hue of the light. Range is 0.0 through 360.0. - - msg.topic = 'hue' - msg.payload = 120.0 - -If `topic` is `saturation` then `payload` must be a number and tells the saturation of the light. Range is 0.0 through 100.0. - - msg.topic = 'saturation' - msg.payload = 100.0 - -If `topic` is `value` then `payload` must be a number and tells the value of the light. Range is 0.0 through 100.0. - - msg.topic = 'value' - msg.payload = 100.0 - -If `topic` is something else then `payload` must be an object and tells all the states of the light. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true, - brightness: 100, - hue: 120.0, - saturation: 100.0, - value: 100.0 - } - -#### - Color (RGB) Light -`topic` can be `on`, `online`, `brightness`, `rgb` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the light. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the light. - - msg.topic = 'online' - msg.payload = true - -If `topic` is `brightness` then `payload` must be a number and tells the brightness of the light. Range is 0 through 100. - - msg.topic = 'brightness' - msg.payload = 75 - -If `topic` is `rgb` then `payload` must be a number and tells the RGB values of the light. Range is 0 through 16777215. - - msg.topic = 'rgb' - msg.payload = 255 - -*Hint:* red = 16711680, green = 65280, blue = 255. - -If `topic` is something else then `payload` must be an object and tells all the states of the light. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true, - brightness: 100, - rgb: 255, - } - -#### - Color (RGB/Temp) Light -`topic` can be `on`, `online`, `brightness`, `temperature`, `rgb` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the light. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the light. - - msg.topic = 'online' - msg.payload = true - -If `topic` is `brightness` then `payload` must be a number and tells the brightness of the light. Range is 0 through 100. - - msg.topic = 'brightness' - msg.payload = 75 - -If `topic` is `temperature` then `payload` must be a number and tells the color temperature of the light. Range is 2000 through 6000. - - msg.topic = 'temperature' - msg.payload = 3000 - -If `topic` is `rgb` then `payload` must be a number and tells the RGB values of the light. Range is 0 through 16777215. - - msg.topic = 'rgb' - msg.payload = 255 - -*Hint:* red = 16711680, green = 65280, blue = 255. - -If `topic` is something else then `payload` must be an object and tells all the states of the light. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true, - brightness: 100, - temperature: 3000, - rgb: 255, - } - -#### - Camera -`topic` can be `online` or something else. - -If `topic` is `online` then `payload` must be boolean and tells the online state of the camera. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the online state of the camera. - - msg.topic = 'set' - msg.payload = { - online: true - } - -Example flow: - - [{"id":"980e90e8.c7796","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/camera/power","qos":"2","datatype":"auto","broker":"","x":530,"y":460,"wires":[["6637f52f.da97cc"]]},{"id":"6f5daaf0.f5dce4","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/camera/set-power","qos":"","retain":"","broker":"","x":1340,"y":460,"wires":[]},{"id":"9eca40d3.9338b","type":"google-camera","z":"1fdba310.d04cad","client":"","name":"Example Camera","topic":"example","passthru":false,"x":940,"y":460,"wires":[["48723761.d78bb8"]]},{"id":"6637f52f.da97cc","type":"change","z":"1fdba310.d04cad","name":"topic = online","rules":[{"t":"set","p":"topic","pt":"msg","to":"online","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":460,"wires":[["9eca40d3.9338b"]]},{"id":"48723761.d78bb8","type":"function","z":"1fdba310.d04cad","name":"Split","func":"return [\n { payload: msg.payload.online },\n];","outputs":1,"noerr":0,"x":1130,"y":460,"wires":[["6f5daaf0.f5dce4"]],"outputLabels":["online"]}] - -#### - Outlet -`topic` can be `on`, `online` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the outlet. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the outlet. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the on state as well as the online state of the outlet. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true - } - -Example flow: - - [{"id":"980e90e8.c7796","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/outlet/power","qos":"2","datatype":"auto","broker":"","x":530,"y":460,"wires":[["6637f52f.da97cc"]]},{"id":"6f5daaf0.f5dce4","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/outlet/set-power","qos":"","retain":"","broker":"","x":1340,"y":460,"wires":[]},{"id":"9eca40d3.9338b","type":"google-outlet","z":"1fdba310.d04cad","client":"","name":"Example Outlet","topic":"example","passthru":false,"x":940,"y":460,"wires":[["48723761.d78bb8"]]},{"id":"6637f52f.da97cc","type":"change","z":"1fdba310.d04cad","name":"topic = on","rules":[{"t":"set","p":"topic","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":460,"wires":[["9eca40d3.9338b"]]},{"id":"48723761.d78bb8","type":"function","z":"1fdba310.d04cad","name":"Split","func":"return [\n { payload: msg.payload.on },\n];","outputs":1,"noerr":0,"x":1130,"y":460,"wires":[["6f5daaf0.f5dce4"]],"outputLabels":["on"]}] - -#### - Thermostat -`topic` can be `thermostatTemperatureAmbient`, `thermostatTemperatureSetpoint` or something else. - -If `topic` is `thermostatTemperatureAmbient` then `payload` must be a float and indicates the current ambient (room) temperature. - - msg.topic = 'thermostatTemperatureAmbient' - msg.payload = 21.5 - -If `topic` is `thermostatTemperatureSetpoint` then `payload` must be a float and indicates the target temperature of the thermostat. - - msg.topic = 'thermostatTemperatureSetpoint' - msg.payload = 20.0 - -If `topic` is `online` then `payload` must be boolean and tells the online state of the thermostat. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells the online state, ambient and target temperature of the thermostat. - - msg.topic = 'set' - msg.payload = { - thermostatTemperatureAmbient: 21.5, - thermostatTemperatureSetpoint: 20.0, - online: true - } - -Example flow: - - [{"id":"891efa41.8e8308","type":"google-thermostat","z":"1fdba310.d04cad","client":"","name":"Example Thermostat","topic":"example","passthru":false,"x":940,"y":740,"wires":[["cdfe8ddc.ab3c6"]]},{"id":"3086bc12.910434","type":"change","z":"1fdba310.d04cad","name":"topic = thermostatTemperatureAmbient","rules":[{"t":"set","p":"topic","pt":"msg","to":"thermostatTemperatureAmbient","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":720,"wires":[["891efa41.8e8308"]]},{"id":"1344bd56.a60ac3","type":"change","z":"1fdba310.d04cad","name":"topic = thermostatTemperatureSetpoint","rules":[{"t":"set","p":"topic","pt":"msg","to":"thermostatTemperatureSetpoint","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":760,"wires":[["891efa41.8e8308"]]},{"id":"cdfe8ddc.ab3c6","type":"function","z":"1fdba310.d04cad","name":"Split","func":"return [\n { payload: msg.payload.thermostatTemperatureSetpoint },\n];\n\n// Google returns thermostat mode too, but we currently don't handle different thermostat modes","outputs":1,"noerr":0,"x":1130,"y":740,"wires":[["e2c467bd.2a2e58"]],"outputLabels":["thermostatTemperatureSetpoint"]},{"id":"5efccd01.2e28f4","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/kitchen/current-temp","qos":"2","datatype":"auto","broker":"","x":350,"y":720,"wires":[["3086bc12.910434"]]},{"id":"62becde4.16ca84","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/kitchen/target-temp","qos":"2","datatype":"auto","broker":"","x":350,"y":760,"wires":[["1344bd56.a60ac3"]]},{"id":"e2c467bd.2a2e58","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/kitchen/set-target-temp","qos":"","retain":"","broker":"","x":1340,"y":740,"wires":[]}] - -#### - Window -`topic` can be `openPercent`, `online` or something else. - -If `topic` is `openPercent` then `payload` must be integer and indicates the percentage that the window is opened -where 0 is closed and 100 is fully open. It can also be boolean where false is closed and true is 100% opened. - - msg.topic = 'openPercent' - msg.payload = 50 - - -If `topic` is `online` then `payload` must be boolean and tells the online state of the window. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the open state as well as the online state of the window. - - msg.topic = 'set' - msg.payload = { - openPercent: 50, - online: true - } - -Example flow: - - [{"id":"9a73b064.fff81","type":"google-window","z":"1fdba310.d04cad","client":"","name":"Example Window","topic":"example","passthru":false,"x":890,"y":1340,"wires":[["90d22fa7.814b2"]]},{"id":"d928b0f2.a4b38","type":"change","z":"1fdba310.d04cad","name":"topic = openPercent","rules":[{"t":"set","p":"topic","pt":"msg","to":"openPercent","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1340,"wires":[["9a73b064.fff81"]]},{"id":"90d22fa7.814b2","type":"function","z":"1fdba310.d04cad","name":"Split","func":"return [\n { payload: msg.payload.openPercent },\n];","outputs":1,"noerr":0,"x":1070,"y":1340,"wires":[["51c28adb.ae4ae4"]],"outputLabels":["openPercent"]},{"id":"ac90bdcb.277bc","type":"mqtt in","z":"1fdba310.d04cad","name":"","topic":"home/window/state","qos":"2","datatype":"auto","broker":"","x":430,"y":1340,"wires":[["d928b0f2.a4b38"]]},{"id":"51c28adb.ae4ae4","type":"mqtt out","z":"1fdba310.d04cad","name":"","topic":"home/window/set-state","qos":"","retain":"","broker":"","x":1260,"y":1340,"wires":[]}] - - -#### - Scene -Messages sent to this node is simply passed through. One cannot tell Google SmartHome to activate a scene, they tell us. - - -#### - Vacuum -`topic` can be `on`, `online` or something else. - -If `msg.topic` is `currentModeSettings.power` then `msg.payload` must be string and tells the mode of the vacuum. It -can be one of `quiet`, `standard`, `medium` or `turbo`. - - msg.topic = 'currentModeSettings.power' - msg.payload = 'standard' - -If `msg.topic` is `capacityRemaining.rawValue` then `msg.payload` must be integer and tells the current battery power -of the vacuum in percent. - - msg.topic = 'capacityRemaining.rawValue' - msg.payload = 100 - -If `msg.topic` is `isCharging` then `msg.payload` must be boolean and tells if the vacuum is charging. - - msg.topic = 'isCharging' - msg.payload = true - -If `topic` is `on` then `payload` must be boolean and tells the state of the vacuum. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the vacuum. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the on state as well as the online state of the vacuum. - - msg.topic = 'set' - msg.payload = { - currentModeSettings.power = 'standard' - capacityRemaining.rawValue' = 100 - isCharging = true - on: true, - online: true - } - - -#### - Fan -`topic` can be `on`, `online` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the fan. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the fan. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the on state as well as the online state of the fan. - - msg.topic = 'set' - msg.payload = { - on: true, - online: true - } - -#### - Kitchen Hood -`topic` can be `on`, `online` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the kitchen hood. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the kitchen hood. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the on state as well as the online state of the kitchen hood. - - msg.topic = 'set' - msg.payload = { - on: true, - online: true - } - -#### - Fireplace -`topic` can be `on`, `online` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the fireplace. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the fireplace. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the on state as well as the online state of the fireplace. - - msg.topic = 'set' - msg.payload = { - on: true, - online: true - } - -#### - Sensor -`topic` can be `temperatureAmbientCelsius`, `humidityAmbientPercent` or something else. - -If `topic` is `temperatureAmbientCelsius` then `payload` must be a number that tells the sensor temperature (in celsius). - - msg.topic = 'temperatureAmbientCelsius' - msg.payload = 19.5 - -If `topic` is `humidityAmbientPercent` then `payload` must be a number that tells the sensor ambient humidity (as percentage). - - msg.topic = 'humidityAmbientPercent' - msg.payload = 70 - -If `topic` is something else then `payload` must be an object, that tells the states of the sensor. - - msg.topic = '' - msg.payload = { - temperatureAmbientCelsius: 17.5, - humidityAmbientPercent: 60 - } - -#### - Shutter -`topic` can be `openPercent`, `online` or something else. - -If `topic` is `openPercent` then `payload` must be integer and indicates the percentage that the shutter is opened -where 0 is closed and 100 is fully open. It can also be boolean where false is closed and true is 100% opened. - - msg.topic = 'openPercent' - msg.payload = 50 - - -If `topic` is `online` then `payload` must be boolean and tells the online state of the shutter. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the open state as well as the online state of the shutter. - - msg.topic = 'set' - msg.payload = { - openPercent: 50, - online: true - } - -#### - Blind -`topic` can be `openPercent`, `online` or something else. - -If `topic` is `openPercent` then `payload` must be integer and indicates the percentage that the blind is opened -where 0 is closed and 100 is fully open. It can also be boolean where false is closed and true is 100% opened. - - msg.topic = 'openPercent' - msg.payload = 50 - - -If `topic` is `online` then `payload` must be boolean and tells the online state of the blind. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the open state as well as the online state of the blind. - - msg.topic = 'set' - msg.payload = { - openPercent: 50, - online: true - } - -#### - Switch -`topic` can be `on`, `online` or something else. - -If `topic` is `on` then `payload` must be boolean and tells the state of the switch. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `online` then `payload` must be boolean and tells the online state of the switch. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells both the on state as well as the online state of the switch. - - msg.topic = 'set' - msg.payload = { - on: false, - online: true - } - -#### - Audio/Video Receiver -#### - Remote Control -#### - Set-Top Box -#### - Sound Bar -#### - Speaker -#### - Streaming Box -#### - Streaming Sound Bar -#### - Streaming Stick -#### - Television -`topic` can be `currentApplication`, `currentInput`, `activityState`, `playbackState`, -`on`, `currentVolume`, `isMuted`, `toggles`, `modes` or something else. - -If `topic` is `currentApplication` then `payload` must be a string and indicates the current application running. - - msg.topic = 'currentApplication' - msg.payload = 'youtube' - -If `topic` is `currentInput` then `payload` must be a string and indicates the current input selected. - - msg.topic = 'currentInput' - msg.payload = 'hdmi_1' - -If `topic` is `activityState` then `payload` must be a string and indicates the active state of the media device. Supported values are `INACTIVE`, `STANDBY`, `ACTIVE`. - - msg.topic = 'activityState' - msg.payload = 'ACTIVE' - -If `topic` is `playbackState` then `payload` must be a string and indicates the playback state of the media device. Supported values are `PAUSED`, `PLAYING`, `FAST_FORWARDING`, `REWINDING`, `BUFFERING`, `STOPPED`. - - msg.topic = 'playbackState' - msg.payload = 'PAUSED' - -If `topic` is `on` then `payload` must be boolean and tells the state of the media devices. - - msg.topic = 'on' - msg.payload = true - -If `topic` is `currentVolume` then `payload` must be an integer and indicates the current volume level. - - msg.topic = 'currentVolume' - msg.payload = 5 - -If `topic` is `isMuted` then `payload` must be boolean and tells the mute state of the media devices. - - msg.topic = 'isMuted' - msg.payload = true - -If `topic` is `currentModeSettings` then `payload` must be an object and indicates the modes state of the media device. - - msg.topic = 'currentModeSettings' - msg.payload = { - "load_mode": "small_load", - "temp_mode": "cold_temp" - } - -If `topic` is `currentToggleSettings` then `payload` must be an object and indicates the toggles state of the media device. - - msg.topic = 'currentToggleSettings' - msg.payload = { - "sterilization_toggle": true, - "energysaving_toggle": false - } - -If `topic` is `applications` then `payload` must be json string, json object and tells the available applications of the media devices. The available applications will be saved on the applications file. - - msg.topic = 'applications' - msg.payload = {....} - -If `topic` is `applications` then `payload` is undefined the available applications will be loaded from the applications file. - - msg.topic = 'applications' - -If `topic` is `channels` then `payload` must be json string, json object and tells the available channels of the media devices. The available channels will be saved on the channels file. - - msg.topic = 'channels' - msg.payload = {....} - -If `topic` is `channels` then `payload` is undefined the available channels will be loaded from the channels file. - - msg.topic = 'channels' - -If `topic` is `inputs` then `payload` must be json string, json object and tells the available inputs of the media devices. The available inputs will be saved on the inputs file. - - msg.topic = 'inputs' - msg.payload = {....} - -If `topic` is `inputs` then `payload` is undefined the available inputs will be loaded from the inputs file. - - msg.topic = 'inputs' - -If `topic` is `modes` then `payload` must be json string, json object and tells the available modes of the media devices. The available modes will be saved on the modes file. - - msg.topic = 'modes' - msg.payload = {....} - -If `topic` is `modes` then `payload` is undefined the available modes will be loaded from the modes file. - - msg.topic = 'modes' - -If `topic` is `toggles` then `payload` must be json string, json object and tells the available toggles of the media devices. The available toggles will be saved on the toggles file. - - msg.topic = 'toggles' - msg.payload = {....} - -If `topic` is `toggles` then `payload` is undefined the available toggles will be loaded from the toggles file. - - msg.topic = 'toggles' - -If `topic` is `online` then `payload` must be boolean and tells the online state of the media devices. - - msg.topic = 'online' - msg.payload = true - -If `topic` is something else then `payload` must be an object and tells every attribute. - - msg.topic = 'set' - msg.payload = { - currentApplication: 'youtube', - currentInput: 'hdmi_1', - activityState: 'ACTIVE', - playbackState: 'PAUSED', - on: true, - currentVolume: 5, - isMuted: false, - currentToggleSettings:{ - "sterilization_toggle": true, - "energysaving_toggle": false - }, - currentModeSettings: { - "load_mode": "small_load", - "temp_mode": "cold_temp" - }, - online: true - } - -Example flow: - - [{"id":"985701ca.58de9","type":"google-media","z":"6575ac93.01c874","client":"","name":"Example Television","topic":"tv","device_type":"TV","has_apps":false,"has_channels":true,"has_inputs":false,"has_media_state":false,"has_on_off":false,"has_transport_control":false,"has_modes":true,"has_toggles":true,"available_applications_file":"applications.json","available_channels_file":"channels.json","available_inputs_file":"inputs.json","command_only_input_selector":"","ordered_inputs":"","support_activity_state":false,"support_playback_state":false,"command_only_on_off":false,"query_only_on_off":false,"supported_commands":[],"volume_max_level":"50","can_mute_and_unmute":"","volume_default_percentage":40,"level_step_size":1,"command_only_volume":false,"available_modes_file":"modes.json","command_only_modes":false,"query_only_modes":false,"available_toggles_file":"toggles.json","command_only_toggles":false,"query_only_toggles":false,"passthru":false,"x":550,"y":200,"wires":[["48723761.d78bb8"]]},{"id":"48723761.d78bb8","type":"function","z":"6575ac93.01c874","name":"Split","func":"return [\n { payload: msg.payload.online },\n];","outputs":1,"noerr":0,"x":730,"y":200,"wires":[["6f5daaf0.f5dce4"]],"outputLabels":["online"]},{"id":"6637f52f.da97cc","type":"change","z":"6575ac93.01c874","name":"topic = online","rules":[{"t":"set","p":"topic","pt":"msg","to":"online","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":200,"wires":[["985701ca.58de9"]]},{"id":"4d3983f6.6f373c","type":"function","z":"6575ac93.01c874","name":"","func":"let msg1={\"topic\": msg.topic};\nlet lang=msg.lang || 'en';\nlet toggles = [];\nmsg1.payload = toggles;\nmsg.payload.forEach(toggle => {\n if (typeof toggle == \"string\") {\n let new_toggle = {};\n let key = toggle.replace(/ /g, '_');\n if (!key.toLowerCase().endsWith(\"toggle\")) {\n key = key + \"_toggle\";\n }\n new_toggle['name'] = key.toLowerCase();\n new_toggle['name_values'] = [{\n \"lang\": lang,\n \"name_synonym\": [ toggle ]\n }];\n toggles.push(new_toggle);\n } else if (typeof toggle == \"object\") {\n let key = toggle['key'];\n let names = toggle['names'];\n if (key == undefined) {\n key = names[0].replace(/ /g, '_');\n }\n if (!key.toLowerCase().endsWith(\"toggle\")) {\n key = key + \"_toggle\";\n }\n let new_toggle = {};\n new_toggle['name'] = key.toLowerCase();\n new_toggle['name_values'] = [{\n \"lang\": lang,\n \"name_synonym\": names\n }];\n toggles.push(new_toggle);\n }\n});\n\nreturn msg1;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":240,"wires":[["985701ca.58de9"]]},{"id":"2cfd736e.156d5c","type":"function","z":"6575ac93.01c874","name":"","func":"const topic = msg.topic.toLowerCase().slice(0, -1);\nlet msg1={\"topic\": msg.topic};\nlet lang=msg.lang || 'en';\nlet objs = [];\nmsg1.payload = objs;\nmsg.payload.forEach(obj => {\n if (typeof obj == \"string\") {\n let new_obj = {};\n let key = obj.replace(/ /g, '_').toLowerCase();\n if (!key.endsWith(topic)) {\n key = key + \"_\" + topic;\n }\n new_obj['key'] = key;\n new_obj['names'] = [{\n \"lang\": lang,\n \"name_synonym\": [ obj ]\n }];\n objs.push(new_obj);\n } else if (typeof obj == \"object\") {\n let new_obj = {};\n let key = obj['key'];\n let names = obj['names'];\n if (key == undefined) {\n key = names[0];\n }\n key = key.replace(/ /g, '_').toLowerCase();\n if (!key.endsWith(topic)) {\n key = key + \"_\" + topic;\n }\n new_obj['key'] = key;\n let new_objt = {};\n new_obj['key'] = key;\n new_obj['names'] = [{\n \"lang\": lang,\n \"name_synonym\": names\n }];\n objs.push(new_obj);\n }\n});\n\nreturn msg1;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":280,"wires":[["985701ca.58de9"]]},{"id":"387845e5.5e2f5a","type":"inject","z":"6575ac93.01c874","name":"Channels","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Channels","payload":"[{\"key\":\"rai1\",\"names\":[\"Rai 1\"],\"number\":\"1\"},{\"key\":\"rai1_hd\",\"names\":[\"Rai 1 HD\"],\"number\":\"501\"},{\"key\":\"rai2\",\"names\":[\"Rai 2\"],\"number\":\"2\"},{\"key\":\"rai2_hd\",\"names\":[\"Rai 2 HD\"],\"number\":\"502\"},{\"key\":\"rai3\",\"names\":[\"Rai 3\"],\"number\":\"3\"},{\"key\":\"rai3_hd\",\"names\":[\"Rai 3 HD\"],\"number\":\"503\"},{\"key\":\"realtime\",\"names\":[\"Realtime\"],\"number\":\"31\"}]","payloadType":"json","x":120,"y":360,"wires":[["985701ca.58de9"]]},{"id":"3b17441c.9a3f0c","type":"inject","z":"6575ac93.01c874","name":"Modes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Modes","payload":"[{\"name\":\"load_mode\",\"name_values\":[{\"name_synonym\":[\"load\",\"size\",\"load size\"],\"lang\":\"en\"}],\"settings\":[{\"setting_name\":\"small_load\",\"setting_values\":[{\"setting_synonym\":[\"small\",\"half\"],\"lang\":\"en\"}]},{\"setting_name\":\"medium_load\",\"setting_values\":[{\"setting_synonym\":[\"medium\",\"normal\"],\"lang\":\"en\"}]},{\"setting_name\":\"large_load\",\"setting_values\":[{\"setting_synonym\":[\"large\",\"full\"],\"lang\":\"en\"}]}],\"ordered\":true},{\"name\":\"temp_mode\",\"name_values\":[{\"name_synonym\":[\"temperature\",\"temp\"],\"lang\":\"en\"}],\"settings\":[{\"setting_name\":\"hot_temp\",\"setting_values\":[{\"setting_synonym\":[\"hot\",\"white\"],\"lang\":\"en\"}]},{\"setting_name\":\"warm_temp\",\"setting_values\":[{\"setting_synonym\":[\"warm\",\"color\"],\"lang\":\"en\"}]},{\"setting_name\":\"cold_temp\",\"setting_values\":[{\"setting_synonym\":[\"cold\",\"delicate\"],\"lang\":\"en\"}]}],\"ordered\":false}]","payloadType":"json","x":110,"y":400,"wires":[["985701ca.58de9"]]},{"id":"6f5daaf0.f5dce4","type":"mqtt out","z":"6575ac93.01c874","name":"","topic":"home/tv/set-power","qos":"","retain":"","broker":"","x":920,"y":200,"wires":[]},{"id":"980e90e8.c7796","type":"mqtt in","z":"6575ac93.01c874","name":"","topic":"home/tv/power","qos":"2","datatype":"auto","broker":"","x":120,"y":200,"wires":[["6637f52f.da97cc"]]},{"id":"8a2472a.979da9","type":"inject","z":"6575ac93.01c874","name":"Toggles","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"toggles","payload":"[\"quiet\",{\"key\":\"extra_bass\",\"names\":[\"Extra bass\",\"Loud bass\",\"Powerful bass\"]},{\"names\":[\"Energy Saving\",\"Low Energy\"]}]","payloadType":"json","x":110,"y":240,"wires":[["4d3983f6.6f373c"]]},{"id":"ce4d650b.8098a8","type":"inject","z":"6575ac93.01c874","name":"Inputs","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Inputs","payload":"[\"hdmi 1\",{\"key\":\"hdmi_2\",\"names\":[\"hdmi 2\",\"Second HDMI\",\"DVD Reader\",\"DVD\"]},{\"names\":[\"hdmi 3\",\"Third HDMI\",\"Playstation 5\",\"PS5\"]}]","payloadType":"json","x":110,"y":280,"wires":[["2cfd736e.156d5c"]]},{"id":"7fa56940.bf6298","type":"inject","z":"6575ac93.01c874","name":"Apps","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Applications","payload":"[\"YouTube\",{\"key\":\"video\",\"names\":[\"Google Vide\",\"Video\"]},{\"names\":[\"Amazon Prime Video\",\"Prime Video\"]}]","payloadType":"json","x":110,"y":320,"wires":[["2cfd736e.156d5c"]]}] +All other device nodes except the Google device are deprecated. Please use the Google device node instead. #### - Management `topic` can be `restart_server`, `report_state` or `request_sync`.