Raspberry Pi System Monitor to HA - Confusion re Topic

Hi all,

I’m trying to implement this Pi system monitor into HA.

https://pimylifeup.com/home-assistant-raspberry-pi-system-monitor/comment-page-1/?unapproved=96477&moderation-hash=83b9f8f31c136571f43ae6515dd63d72#comment-96477

I have it running on a Zero 2 W which is publishing every 5 minutes.

I can see the data for this the topic ok in MQTT Explorer and Mosquito MQTT/Setting/Listen to a topic with no problem. See below.

I added a sensor in configuration.yaml under mqtt:sensor: for “up_time” (see below) but can’t get HA/Developer tools/states to return a value.

I feel I have some basic error in the config file with the topic (or not…) but I can’t see it.

Enlightenment always appreciated!

Hey there, @Mark285907,

Out of curiosity, are you able to pull “up_time_secs” by any chance? I ask because it looks like “up_time” is formatted as a string whereas “up_time_secs” is formatted as an integer. I’m not sure if that would make a difference.

Thanks Jane but nothing on that either.

up_time_secs returns unknown.

1 Like

Sorted.

As suspected the issue was me not understanding the sections with the json string.

Info section:
○ Up_time_secs = value_json.info.up_time_secs
○ Temperature_c = value_json.info.temperature_c
Networking section:
○ IP = value_json.info.networking.wlan0.IP
Drives section:
○ Size_gb = value_json.info.drives.root.size_gb
Memory section:
○ Free_mb = value_json.info.memory.free_mb | int where “| int” defines the value as an integer.

1 Like

Hey, glad you got that sorted.

The funny thing is I wondered about that when I first saw your post.

I saw that ‘info’, thought it seemed weird not to put the values as ‘value_json.info’ and then went, ‘Nah, it’s probably fine.’

That’s why you should always trust your instincts.

1 Like