You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HA's remote_rpi_gpio integration is great but it's not very robust... if the endpoint Pi reboots it never reconnects and the 'parent' HA instance needs to be restarted.
I've added a check to system_sensors to see if there is an active connection on the remote GPIO port from the parent HA instance, and include that flag in the MQTT output. I'm offering it for consideration as a feature update.
Under updateSensors()
if "check_remote_gpio" in settings and settings["check_remote_gpio"]:
payload_str = payload_str + '", "remote_gpio": "' + check_remote_gpio()
The function itself:
def check_remote_gpio():
temp = check_output(['bash', '-c', "netstat -tWn" ]).decode('utf-8')
if ":8888" in temp:
temp = check_output(['bash', '-c', "netstat -tW | grep 8888" ]).decode('utf-8')
if settings["remote_gpio_ip"] not in temp:
return "Not connected"
else:
return "Connected"
else:
return "Not connected"
The text was updated successfully, but these errors were encountered:
andystewart999
changed the title
[Feature update] Add optional check for HA remote_rpi_gpio connectivity
[Feature request] Add optional check for HA remote_rpi_gpio connectivity
Jun 30, 2021
Hi there,
HA's remote_rpi_gpio integration is great but it's not very robust... if the endpoint Pi reboots it never reconnects and the 'parent' HA instance needs to be restarted.
I've added a check to system_sensors to see if there is an active connection on the remote GPIO port from the parent HA instance, and include that flag in the MQTT output. I'm offering it for consideration as a feature update.
Under updateSensors()
The function itself:
Defining the new MQTT field metadata:
New values in settings.yaml:
Thanks again for your continued efforts,
Andy
The text was updated successfully, but these errors were encountered: