hardillb / node-red-alexa-home-skill-web

Apache License 2.0
45 stars 29 forks source link

Response to IncrementColorTemperatureRequest/ DecrementColorTemperatureRequest not possible #46

Closed scobby closed 6 years ago

scobby commented 6 years ago

Hello Hardillb,

cant set the Response for colorTemperature. Can you provide an example?

hardillb commented 6 years ago

The previous issue #39 points to the Alexa docs about what needs to be put in the msg.extra field.

hardillb commented 6 years ago

The following flow has examples for all color temperature commands:

[{"id":"95bd0184.0a5c78","type":"switch","z":"6e407210.d1d774","name":"","property":"command","propertyType":"msg","rules":[{"t":"eq","v":"TurnOnRequest","vt":"str"},{"t":"eq","v":"TurnOffRequest","vt":"str"},{"t":"eq","v":"SetPercentageRequest","vt":"str"},{"t":"eq","v":"IncrementPercentageRequest","vt":"str"},{"t":"eq","v":"DecrementPercentageRequest","vt":"str"},{"t":"eq","v":"SetColorRequest","vt":"str"},{"t":"eq","v":"SetColorTemperatureRequest","vt":"str"},{"t":"eq","v":"IncrementColorTemperatureRequest","vt":"str"},{"t":"eq","v":"DecrementColorTemperatureRequest","vt":"str"}],"checkall":"false","outputs":9,"x":330,"y":420,"wires":[["8884d11e.dbb6d8"],["8884d11e.dbb6d8"],["3dcdf807.566"],["3dcdf807.566"],["3dcdf807.566"],["c86ddd67.4a2c5"],["223fa10e.cb3566"],["c5230567.a2f6c8"],["c5230567.a2f6c8"]]},{"id":"8884d11e.dbb6d8","type":"function","z":"6e407210.d1d774","name":"ON/OFF","func":"msg.payload = true\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":340,"wires":[["f3044d50.fe1e48","44e6b3e7.f7e6d4"]]},{"id":"3dcdf807.566","type":"function","z":"6e407210.d1d774","name":"Percent","func":"msg.payload = true;\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":380,"wires":[["f3044d50.fe1e48","44e6b3e7.f7e6d4"]]},{"id":"c86ddd67.4a2c5","type":"function","z":"6e407210.d1d774","name":"Color","func":"msg.extra = {\n    achievedState: {\n        color: msg.payload\n    }\n};\nmsg.payload = true;\n\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":420,"wires":[["f3044d50.fe1e48","44e6b3e7.f7e6d4"]]},{"id":"223fa10e.cb3566","type":"function","z":"6e407210.d1d774","name":"Color Temperature","func":"msg.extra = {\n    achievedState: {\n        colorTemperature: {\n            value: msg.payload\n        }\n    }\n};\nmsg.payload = true;\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":460,"wires":[["f3044d50.fe1e48","44e6b3e7.f7e6d4"]]},{"id":"c5230567.a2f6c8","type":"function","z":"6e407210.d1d774","name":"Change Color Temp","func":"msg.extra = {\n    achievedState: {\n        colorTemperature: {\n            value: 2700\n        }\n    }\n};\nmsg.payload = true;\nreturn msg;","outputs":1,"noerr":0,"x":580,"y":500,"wires":[["f3044d50.fe1e48","44e6b3e7.f7e6d4"]]}]