Turn off Zigbee plug through Alexa Echo Dot voice command

I have a couple of WiFi plugs which I am slowly transitioning to Zigbee plugs. Initially, using the WiFi plugs, I set up an automation in the TuYa Smart Life app (which is available as a scene in HA) to turn off all plugs when I go to sleep. However, I have now replaced 1 WiFi plug with a Zigbee plug and I can’t add the Zigbee plug to the Smart Life app, because I need to connect a Zigbee hub first but I’m using a CC2531, hence I cannot add the Zigbee plug to the scene either to have it turned off.

The reason I have the scene/automation in Smart Life is because it is activated by an Alexa Echo Dot. At night, I say “Alexa, good night” to activate the scene to turn off all plugs. The issue is now that I can’t seem to find a way to add the new Zigbee plug to this scene so it is turned off as well. Any ideas?

There are two ways to bet voice control of devices in HA. one easy, one harder.

the first and easiest way is signing up for HA Cloud. It costs $5 a month but it’s pretty much plug-n-play.

the other is via a custom method called Haaska (which I’m not 100% sure is still functioning but I think it is) which is free but takes alot more work to get set up and working.

There’s another option if you use Node Red. I’m using a palette called node-red-contrib-alexa-smart-home

Basically, there is a skill that you enable in Alexa, you create devices through the skills website https://red.cb-net.co.uk/ that show up in Alexa, then you link the nodes for those devices to Home Assistant.

This is an on/off switch

[{"id":"3e496b9d0c663eec","type":"server-state-changed","z":"43a54f4c9ef74bed","name":"Garage Light","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.garage_light","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":70,"y":640,"wires":[["7b0edd089c85cebe"]]},{"id":"7b0edd089c85cebe","type":"function","z":"43a54f4c9ef74bed","name":"","func":"if (msg.payload == \"on\") {\n    return { \"payload\" : { \"state\" : { \"power\" : \"ON\" } }, \"acknowledge\" : true };\n}\nelse if (msg.payload == \"off\") {\n    return { \"payload\" : { \"state\" : { \"power\" : \"OFF\" } }, \"acknowledge\" : true };\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":640,"wires":[["724df1c009c89128"]]},{"id":"724df1c009c89128","type":"alexa-smart-home-v3-state","z":"43a54f4c9ef74bed","conf":"","device":"30498","name":"","x":720,"y":640,"wires":[]},{"id":"75fc1f50de4fce76","type":"alexa-smart-home-v3-resp","z":"43a54f4c9ef74bed","x":720,"y":700,"wires":[]},{"id":"94a097bc904e6981","type":"change","z":"43a54f4c9ef74bed","name":"Acknowledge","rules":[{"t":"set","p":"acknowledge","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":700,"wires":[["75fc1f50de4fce76"]]},{"id":"0aed4e811ece6720","type":"api-call-service","z":"43a54f4c9ef74bed","name":"Garage Light","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_{{payload}}","entityId":"switch.garage_light","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":310,"y":700,"wires":[["94a097bc904e6981"]]},{"id":"089d8113aa4262d3","type":"alexa-smart-home-v3","z":"43a54f4c9ef74bed","conf":"","device":"30498","acknowledge":false,"name":"","topic":"","x":100,"y":700,"wires":[["0aed4e811ece6720"]]}]

This is a dimmer

[{"id":"a4c5b531b60468f0","type":"api-call-service","z":"43a54f4c9ef74bed","name":"Turn on","server":"","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.entry_light","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":680,"y":900,"wires":[["0e0dfbc8021a63cd"]]},{"id":"dc878513ab306c63","type":"switch","z":"43a54f4c9ef74bed","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"istype","v":"number","vt":"number"},{"t":"eq","v":"OFF","vt":"str"},{"t":"istype","v":"object","vt":"object"}],"checkall":"true","repair":false,"outputs":4,"x":310,"y":920,"wires":[["a4c5b531b60468f0"],["431a2f253a2a65e2"],["5c78f5ee09e46bcc"],[]]},{"id":"5c78f5ee09e46bcc","type":"api-call-service","z":"43a54f4c9ef74bed","name":"Turn off","server":"","version":3,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.entry_light","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":500,"y":960,"wires":[["0e0dfbc8021a63cd"]]},{"id":"431a2f253a2a65e2","type":"function","z":"43a54f4c9ef74bed","name":"Brightness","func":"var payload = msg.payload;\nmsg.payload =  {  \n      \"data\":{  \n         \"brightness_pct\":payload\n      }\n   }\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":920,"wires":[["a4c5b531b60468f0"]]},{"id":"92e6263042e90ba4","type":"alexa-smart-home-v3","z":"43a54f4c9ef74bed","conf":"","device":"30587","acknowledge":false,"name":"","topic":"Test Light","x":140,"y":920,"wires":[["dc878513ab306c63"]]},{"id":"aa304dbf61bb389d","type":"server-state-changed","z":"43a54f4c9ef74bed","name":"Entry Light","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.entry_light","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":840,"wires":[["7caf7916d6b8eca6","54604d46acf7f110"],["54604d46acf7f110"]]},{"id":"f4912e4bb8cb3c58","type":"alexa-smart-home-v3-state","z":"43a54f4c9ef74bed","conf":"","device":"30587","name":"","x":920,"y":840,"wires":[]},{"id":"54604d46acf7f110","type":"function","z":"43a54f4c9ef74bed","name":"","func":"if (msg.payload == \"on\") {\n    return { \"payload\" : { \"state\" : { \"power\" : \"ON\" } }, \"acknowledge\" : true };\n}\nelse if (msg.payload == \"off\") {\n    return { \"payload\" : { \"state\" : { \"power\" : \"OFF\" } }, \"acknowledge\" : true };\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":840,"wires":[["f4912e4bb8cb3c58"]]},{"id":"0e0dfbc8021a63cd","type":"change","z":"43a54f4c9ef74bed","name":"Acknowledge","rules":[{"t":"set","p":"acknowledge","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":960,"wires":[["c603dee107515161"]]},{"id":"7caf7916d6b8eca6","type":"api-render-template","z":"43a54f4c9ef74bed","name":"Brightness","server":"","version":0,"template":"{{((states.light.entry_light.attributes.brightness)/255*100) | int }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":410,"y":800,"wires":[["c0130ee8255a3d65"]]},{"id":"c0130ee8255a3d65","type":"function","z":"43a54f4c9ef74bed","name":"Brightness","func":"var payload = msg.payload;\nmsg.payload =  {  \n          state : {\n            \"brightness\": payload\n        }\n    }\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":800,"wires":[["a0e6d292d8f3b203"]]},{"id":"a0e6d292d8f3b203","type":"stoptimer","z":"43a54f4c9ef74bed","duration":"1","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":760,"y":800,"wires":[["f4912e4bb8cb3c58"],[]]},{"id":"c603dee107515161","type":"alexa-smart-home-v3-resp","z":"43a54f4c9ef74bed","x":1040,"y":960,"wires":[]}]
1 Like