This python script that runs every 60 seconds and sends several system data over MQTT. It uses the MQTT Discovery for Home Assistant so you don’t need to configure anything in Home Assistant if you have discovery enabled for MQTT
It currently logs the following data:
- BME280 Temperature
- BME280 Humidity
- CPU usage
- CPU temperature
- Disk usage
- Memory usage
- Power status of the RPI
- Last boot
- Enable I2C and SPI
- pip3 install -r requirements.txt --user
- sudo cp ~/ha-enviroplus/enviroplus-monitor.service /etc/systemd/system
- sudo systemctl enable enviroplus-monitor.service
- sudo systemctl start system_sensor.service
The only config you need in Home Assistant is the following:
mqtt:
discovery: true
discovery_prefix: homeassistant
I have used following custom plugins for lovelace:
- vertical-stack-in-card
- mini-graph-card
- bar-card
Config:
- type: 'custom:vertical-stack-in-card'
title: Enviro+ System Monitor
cards:
- type: horizontal-stack
cards:
- type: custom:mini-graph-card
entities:
- sensor.enviropluscpuusage
name: CPU
line_color: '#2980b9'
line_width: 2
hours_to_show: 24
- type: custom:mini-graph-card
entities:
- sensor.enviroplustemperature
name: Temp
line_color: '#2980b9'
line_width: 2
hours_to_show: 24
- type: custom:bar-card
entity: sensor.enviroplusdiskuse
title: HDD
title_position: inside
align: split
show_icon: true
color: '#00ba6a'
- type: custom:bar-card
entity: sensor.enviroplusmemoryuse
title: RAM
title_position: inside
align: split
show_icon: true
- type: entities
entities:
- sensor.enviropluslastboot
- sensor.enviropluspowerstatus