Closed stanogustafik closed 11 months ago
https://github.com/ironsheep/lovelace-rpi-monitor-card#example-monitoring-of-specific-attributes Any use?
I tried a few things, but I never could split the sub attributes.
Might be worth a question with the HA forum.
The card is great... but no chance to add any additional values... and with mqqt sensor programming in Home Assistant I just need a little advice...
SOLUTION:
the answer is that you can read nested attributes from the monitor sensor (its primary value is time in seconds or minutes from last sensor update) - there are nested values... no need to read directly mqtt, they are already read in this sensor. Then the template sensors in configuration.yaml are:
template:
- sensor:
name: "Storage used percentage"
state_class: measurement
unit_of_measurement: '%'
state: "{{ state_attr('sensor.dietpi_rpi_monitor', 'drives' )['mnt-store']['used_prcnt'] }}"
- sensor:
name: "Raspberry IP address"
state: "{{ state_attr('sensor.dietpi_rpi_monitor', 'networking' )['eth0']['IP'] }}"
- sensor:
name: "Raspberry monitor interval"
unit_of_measurement: "minutes"
state: "{{ state_attr('sensor.dietpi_rpi_monitor', 'report_interval' ) }}"
It would be much easier, but when they are "hyphens" or "dashes" used in the attributes´ IDs, you have to use this syntax with ["..."]["..."]
I hope this could help you, maybe it could be part of wiki or readme file... bye...
Thank you so much for your RPi-Reporter-MQTT2HA-Daemon. Everything works great with my Raspberry Pi 3B+ also with Dietpi software installed on it.
Only thing I cannot solve is how to get some additional or nested values from MQTT to lovelace card or to create MQTT sensor. Here are the values of main sensor as showing in Developer tools States :
Specially I need to get value of "drives/mnt-store/used_prcnt"
I tried everything - to use lovelace attribute card - to create custom MQTT sensor... unsuccesfully...
this is what MQTT explorer shows from rpimonitor:
Please, do you have any suggestions or some example of yaml which would work? Thank you so much!