A sensor that checks your Raspberry Pi charger so its not giving you undervoltage.
To get started put /custom_components/sensor/rpi_power.py
here:
<config directory>/custom_components/rpi_power/
and rename it to sensor.py
Example configuration.yaml:
sensor:
platform: rpi_power
Optional config options:
key | required | default | description |
---|---|---|---|
text_state | no | false |
Sets the description as the state if true . |
Here is some more information about how to improve your Raspberry Pi power situation.
https://github.com/superjamie/lazyweb/wiki/Raspberry-Pi-Power
Here is a simple automation example that will notify you if the psu is failing
- id: 'rpi_power_issue'
alias: Power Problem Notification
trigger:
- platform: numeric_state
entity_id: sensor.rpi_power_status
above: 0
for:
minutes: 1
condition:
action:
service: persistent_notification.create
data:
message: "Charger reported {{ states.sensor.rpi_power_status.state }}"
title: "RPI Power Issue"
Due to how custom_components
are loaded, it is normal to see a ModuleNotFoundError
error on first boot after adding this, to resolve it, restart Home-Assistant.
Licensed under: Creative Commons Attribution-ShareAlike 4.0 International License