My first post so be kind, pls I have only used HA for about a week.
I want to send a request from my HA over internet to my Homey (on a different location). I just want my HA to check if my Homey is online (connected to internet). To connect to my HA a use a cloudflare tunnel.
My best guess is that I have to send an http (something, request?) to Homey. Homey then send an answer to HA. If HA gets an answer from Homey a button for example turns green. If no answer (after maybee 5 attempts) from Homey HA turns the button red (and starts an automation).
Can anyone pls point me in the right direction how to set upp the communication between HA and Homey?
Yes I know but I´m not able to configure my router to allow ping I have tried that for a couple of days (whiteout any success) and now I´m looking for another solution.
I wrote a post on the Homey forum on how to connect Homey with IFTTT without using the IFTTT app (that as about to be dropped, but in the end wans’t.). The principle described there (for both directions of communication) can also easily be done between HA and Homey:
You can either have Homey do a webrequest to HA to say it is alive, or have HA try to send something to Homey. The first is probably the most certainty Homey is working properly.
On the HA side you need a webhook trigger or a restful command, depending on the direction of communication:
Another option would be to see if the Homey/HA integrations work. That would open up a world of possibilities.
The Homey/HA integration works but I dont see how it could communicate from HA to Homey, the integretion (as i understand it) only collects information from HA to Homey but i want information (Online Yes/no) from Homey to HA.
I think the best for me is to let HA send a question to Homey and depending on answer take action, in my case to turn of a shelly plug if no answer is giving. I´m trying to create some kind of failover function.
Ha sends a question to Homey “are you alive?”
A) Homey reply YES–> nothing happens in HA
B) Homey doesn’t reply-> HA turns off a Shelly plug
The shelly plug powers my main router, so if no answer (2B above) my main router (inlc. Wifi) shuts off and my Huawei LTE then automatically switch from bridge (because wifi isn’t available anymore) mode to 4G.
If it can control entities, it can send information too. At least the community store version can expose scripts you can call from Homey. Or you could flip a switch from HA. But the webrequest method I suggested is by far the most lightweight. After that MQTT or other integrations require more resources, and internally rely on similar constructs.
Yes, that could be done. You can create a timer helper for that. Be sure to check the box to restore the timer on reload. You could also put the actions in the webhook automation itself after a delay, and then set the automation to restart when it is called while it is still running. Or you could set a timestamp that you last saw Homey and react on when that hasn’t changed for a while. Come to think of it: the webhook automation itself remembers when it last ran, so you could just check for that. Possibilities are endless…