ljalves / hfeasy

HFeasy - firmware for HF-LPx100/LPx30 based devices
45 stars 14 forks source link

Keeps showing up in Home Assistant (OS) as unavailable until i reboot the plugs #44

Open PeteDenmark opened 1 year ago

PeteDenmark commented 1 year ago

I have flashed with both the newest firmware and web interface, and both my HF-LPB100 plugs work great, and are auto discovered by Home Assistant mosquitto broker. But every time i restart HA, they are unavailable until i reboot the plugs.

phrogg commented 1 year ago

I have the same issue.

PeteDenmark commented 1 year ago

I have the same issue.

I have made a workaround. I have made an automation that calls the HFeasy plugs reboot URL when HA starts. So HA starts, the plugs reboot, and everything is fine. Not the cleanest, but it works :)

You can call a URL with the Rest command:

So i configuration.yaml:

rest_command: !include rest_commands.yaml

Make a file called rest_commands.yaml and put the following in it:

#restarts HFeasy plugs by calling their URLs
restart_hfeasy_1:
  url: 'http://192.162.1.150:8080/save?restart=Restart'
restart_hfeasy_2:
  url: 'http://192.168.1.151:8080/save?restart=Restart'
restart_hfeasy_3:
  url: 'http://192.168.8.152:8080/save?restart=Restart'

You of course replace the url's with the url's for you specific plugs

Then i go into automations and make one script with the RESTful command to call the rest_commands of each plug.

And finally just make an automation with a trigger "when home assistant is started" and action and script whatever you called the script you made for the RESTful triggers.

phrogg commented 1 year ago

I have the same issue.

I have made a workaround. I have made an automation that calls the HFeasy plugs reboot URL when HA starts. So HA starts, the plugs reboot, and everything is fine. Not the cleanest, but it works :)

You can call a URL with the Rest command:

So i configuration.yaml:

rest_command: !include rest_commands.yaml

Make a file called rest_commands.yaml and put the following in it:

#restarts HFeasy plugs by calling their URLs
restart_hfeasy_1:
  url: 'http://192.162.1.150:8080/save?restart=Restart'
restart_hfeasy_2:
  url: 'http://192.168.1.151:8080/save?restart=Restart'
restart_hfeasy_3:
  url: 'http://192.168.8.152:8080/save?restart=Restart'

You of course replace the url's with the url's for you specific plugs

Then i go into automations and make one script with the RESTful command to call the rest_commands of each plug.

And finally just make an automation with a trigger "when home assistant is started" and action and script whatever you called the script you made for the RESTful triggers.

Nice idea, unluckily unsuited for me as a reboot power cycles the plug.

PeteDenmark commented 1 year ago

Yeah - that sucks.

Guess calling the HFeasy plugs on and off URLs with get commands is the only option left

on: http://\<deviceip>/state?sw=1 off: http://\<deviceip>/state?sw=0