Open rfspereira opened 5 months ago
Yep, I have the same problem, and this has been going on since end of 2023. The problem is that the service does not do an attempt at a re-connection if the network is interrupted after HomeAssistant is launched. Thus you launch HA, it connects to the remote listener on the remote PI, then fails if anything happens to that TCP connection.
A simple retry subroutine should fix this issue, currently the only thing you can do is re-load HA which is a pain in the tail and not something that you can count on for an automation.
i am having the same issue. I have a program in place to turn on/off my rpi and after one power-cycle HA wont reconnect, because it drops the entity after one connection loss. As previously mentioned: it needs a reconnection subroutine.
workaround:
write a small script on the PI to monitor changes, and publish them to MQTT. define your sensors as MQTT sensors in HA.
I am a newbie in python, here's my first take and its working nicely:
from gpiozero import Button from signal import pause import paho.mqtt.publish as publish
def sendout(pin, value):
publish.single("poolRpi/in/" + str(pin), value, hostname="your.mqtt.broker.ip")
buttons = {}
def setup(pin): button = Button(pin, bounce_time = 0.2) button.when_pressed = lambda: sendout(pin, 'ON') button.when_released = lambda: sendout(pin, 'OFF') buttons[pin] = button sendout(pin, 'ON' if button.is_pressed else 'OFF')
pins = [17,22,27] for pin in pins: setup(pin) pause()
The problem
Environment: a) Remote PI is a RPI 3B+ with raspberrypi desktop OS latest version available. Enabled the GPIO. b) Configured Home Assistant with remote_rpi_gpio (as shown on documentation examples). Home Assistant is running on a RPI 4 with the default HA image for RPI 4 and latest version.
All works fine until the moment the remote device is turned off and back on.
After rebooting the only way to get the connection back is to restart home assistant.
What version of Home Assistant Core has the issue?
core-2024.4.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response