An iOS app PiHelper can ssh in to my pi zero2 and show temps, cup, memory etc. I want to have a Lovelace card on my Pi4 that is running Only Hassio to report what this iOS app is doing.
I’m missing something as to what to install where.
Both are headless and Pi4 only controlled by Hassio and terminal plug-in, Pi zero2w is only running Octopi.
That’s why I asked as perhaps because of what the pi zero2 is running etc instructions are different.
Soon the Pi zero 2 I got as far as config Mqtt. Not sure what to fill in. Also does the “mqtt:
discovery: true
discovery_prefix: homeassistant” get placed as a line in the Hassio config on Pi4?
You need an mqtt server (broker) on the pi4. Looks like you have installed the addon.
Now on the pi4 hass machine set up a user and password. That username and password are what you put in the pi zero as user and password. The hostname is the ip of the pi4 hass machine where the broker is running.
The yaml for the broker is not needed for the addon broker.
For user are u saying to make a new Hassio user?
Sometimes I surprise myself on setting things up like My complete Hassio with all automations and then this block!
I went thropugh the install opn the Pi zero via SSh but Im stuck on EXACTLY what files go where.
What config/py file gets edited and goes where and I do have the Mqtt setup as I have my Ring Alram etc setup through that. Cant remeber Hhow I een accom;ished that to be honest.
QUESTION: When I run teh script to get it to connect to MQTT broker, do I have to always leave that terminal window open and running?
I want connecting as i did not have proper MQTT credentials (uer/PW) to connect. I used the one I had in Hassio for MQTT and connected.
Now I see the sensors.
Thanks for getting me going.
When I ran the scripts I figured you the error messages…
Please if possible for the settings.yaml, I didint know what device id was and left it as it was in file.
Now I see my sensors labeled “test” so that answers my question but maybe others may benefit a wiki in “stupid lingo” what each of the “required” parameters mean.
Can you post a formated YAMl for your lovelace cards?
Hello All looking for some help
I think that I have all the items installed correctly, and I set up my settings.yaml starting from the settings_example.yaml.
But when I try and execute “python3 src/system_sensors.py src/settings.yaml” these are the errors that I get.
Any help would be wonderful, thank you.
pi@vpnpi:~/system_sensors $ python3 src/system_sensors.py src/settings.yaml
Traceback (most recent call last):
File "/home/pi/system_sensors/src/system_sensors.py", line 215, in <module>
mqttClient.connect(settings['mqtt']['hostname'], settings['mqtt']['port'])
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 937, in connect
return self.reconnect()
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1115, in reconnect
return self._send_connect(self._keepalive)
File "/home/pi/.local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2611, in _send_connect
1 + 2 + 2 + len(self._client_id)
TypeError: object of type 'int' has no len()
pi@vpnpi:~/system_sensors $
Sennevds Thank You for the reply.
Sorry for not posting back sooner.
Yes, I did find that to be the case.
The IP address was all hosed up.
Once I fixed this, it all work just fine.
So it’s up and running now.
Just decided to give your script a try in one of my RPis and I have noticed that the MQTT server is being spammed with too many messages, I supposed due to this:
For some reason your home assistant instance sends a online message every x seconds. Everytime home assistant sends this message the script will send the current values so ha doesn’t show unknown values. Your issue is with ha and not with the script I think.
I suppose you’re using the birth message sent from HA to MQTT broker (installed as add-on in HA), but as far as I can see from my logs, I don’t see it being sent every x seconds (although it is sent as retained).
As per documentation:
Birth message - The birth message will be sent each time Home Assistant (re)connects to the MQTT broker.