Hello
i am trying to add alexa voice functionality using node red and this pellett
Guide - Introduction — Node-RED Smart Home Control documentation
i am successfully able to on off via alexa but can’t get current switch state so sometimes it turn off switch when i command to turn on
followed this video but not getting how to use function node as this guy is using mqtt and i am using Esphome API
My flow -
[{"id":"23c177ca.515bb8","type":"tab","label":"Alexa test","disabled":false,"info":""},{"id":"a86d8abf.058808","type":"alexa-smart-home-v3","z":"23c177ca.515bb8","conf":"8a84c63d.6ffd98","device":"15217","acknowledge":true,"name":"DIY Relay 1","topic":"","x":210,"y":220,"wires":[["3d1d9f6e.25322","a11cd6c1.c5a1e8"]]},{"id":"3d1d9f6e.25322","type":"alexa-smart-home-v3-state","z":"23c177ca.515bb8","conf":"8a84c63d.6ffd98","device":"15217","name":"DIY Relay 1","x":590,"y":140,"wires":[]},{"id":"d1d7e889.7d97e8","type":"server-state-changed","z":"23c177ca.515bb8","name":"relay 1 power state","server":"53c7df2a.8f295","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.diy_relay_1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":230,"y":140,"wires":[["db6d22d4.37edc"]]},{"id":"107801fa.53888e","type":"api-call-service","z":"23c177ca.515bb8","name":"relay 1 toggle","server":"53c7df2a.8f295","version":1,"debugenabled":false,"service_domain":"switch","service":"toggle","entityId":"switch.diy_relay_1","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":240,"wires":[[]]},{"id":"a11cd6c1.c5a1e8","type":"function","z":"23c177ca.515bb8","name":"","func":"","outputs":1,"noerr":0,"x":410,"y":240,"wires":[["107801fa.53888e"]]},{"id":"db6d22d4.37edc","type":"function","z":"23c177ca.515bb8","name":"","func":"","outputs":1,"noerr":0,"x":410,"y":140,"wires":[["3d1d9f6e.25322"]]},{"id":"8a84c63d.6ffd98","type":"alexa-smart-home-v3-conf","z":"","username":"xyzuser","mqttserver":"mq-red.cb-net.co.uk","webapiurl":"red.cb-net.co.uk","contextName":"memory"},{"id":"53c7df2a.8f295","type":"server","z":"","name":"Home Assistant","addon":true}]