Noticed that alot of people are running with bad power supplies so i decided in a preemptive measurement to post a little sensor that checks if you got a bad power supply or not
Whats the bad deal with any old power supply
Well a raspberry pi cant run of a any mobile power supply that causes system instability and SD corruption so its very important to have a proper power supply
Raspberry Pi Model A
Raspberry Pi Model B+
Raspberry Pi 2 Model B
Raspberry Pi 3 Model B
Raspberry Pi 3 Model B+
700mA
1.8A
1.8A
2.5A
2.5A
This works for Hassbian or manually installed environments not hass.io is currently missing the 4.14 kernel to be able to use this simple sensor. This will work for HassOS thats currently in Release Candidate so look out for a release coming soon
v0.0.5 Changes version format so its trackable by the updater card
v0.0.6 Grammatical fixes (tnx tjorim)
v0.0.7 Add the option to set the desctiption as the state (tnx @ludeeus)
Here is my work in progress a standalone python script with help from other devs such as Robban and @ludeeus huge tnx for all the pointers and help
or you use the following standard sensor to check if your power supply is throttling your cpu (donβt use both)
Kernel version: 4.14+
To update your kernel on Raspbian/Hassbian just run rpi-update to verify that you have 4.14 run uname -r
just add this to your sensor configuration and if you get a message about throttling you seriously need to check your power supply so its up to standards.
If there is evidence of throttling you need to replace your power supply because its not good enough and it will cause issues down the line if its powering your Raspberry Pi.
if the sensor says no throtteling detect everything is fine else = new charger simple all chargers degrade over time so they need to be replaced over time
value_template: >
{% if is_state("sensor.system_undervoltage_status", "throttled=0x0") -%}
No throttling detected
{% elif regex_match(states("sensor.system_undervoltage_status"), "throttled=0x4", ignorecase=FALSE) -%}
Throttling detected {{ states("sensor.system_number_of_undervoltage_messages") }} times
{% elif regex_match(states("sensor.system_undervoltage_status"), "throttled=0x5", ignorecase=FALSE) -%}
Throttling detected {{ states("sensor.system_number_of_undervoltage_messages") }} times
{% else %}
There is a problem with your power supply or system, state {{ states("sensor.system_undervoltage_status") }} reported
{%- endif %}
ok well if someone with hass.io was to try it out so i know it works i would be grateful that way i know if its worth investing in doing a addon for hass.io in general
- platform: template
sensors:
check_charger:
friendly_name: "System: Charger"
value_template: >
{% if is_state("sensor.system_undervoltage_status", "throttled=0x0") -%}
No throttling detected
{% elif regex_match(states("sensor.system_undervoltage_status"), "throttled=0x4", ignorecase=FALSE) or
regex_match(states("sensor.system_undervoltage_status"), "throttled=0x5", ignorecase=FALSE) -%}
Throttling detected {{ states("sensor.system_number_of_undervoltage_messages") }} {{ state_attr("sensor.system_number_of_undervoltage_messages", "unit_of_measurement") }}
{% else -%}
There is a problem with your power supply or system, state {{ states("sensor.system_undervoltage_status") }} reported
{%- endif %}
since popcornmix added /sys/devices/platform/soc/soc:firmware/get_throttled to kernel i might be able to use it instead of having bins etc into hass.io