[HELP] Integrating alexa using Node-red

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}]

Dude. Whats helpful if you didnt cross post, forums, the HA reddit, the nodered subreddit and who knows where else …all at the same time.

Would also help if you posted about home assistant in the home assistant forum.

sorry my bad , new here

i was itching my head and was not getting answer so posted in sub reddit too :confused:

This post is in 3rd party integrations and the OP is re esphome and NodeRed so I think thats fairly appropriate. But its long holiday weekend in the states. People are busy. I get sometimes it is hard to know the ‘best’ place to post but typically I think most would agree ALL of the places isnt the best place.