Raspberry Pi4 - Up & Running

Excellent just checked mine and it’s also working now, not sure on when it was fixed but works on 0.98.1

Can you give me the sensor code for undervoltage and everything what is in this glance card… thank you…

From here

We have published a release candidate of HassOS that is compatible with the new Raspberry Pi 4. Download it here.

Do we need to flash the sd card again and restore a backup to get this updated or do we also get this directly in hassio (system)?

That depends on your skill level as it’s a script that you would need to edit and modify to your server and token, have MQTT up and running also set to run the script as a cron job.

If you understand everything above then yes, but I don’t have time at the moment to tidy up the code, provide detailed step by step instructions and make user friendly.

The was a mention of another component that did the same that my be easier to set up.

D.

p.s this probably won’t work in HASSIO only developer installations

I just wanted the lovelace RAW of Raspberry Pi 4 card sensors… nothing else…

Simple copy/paste…

Yea but that won’t work without the underlying code to provide the data to Home Assistant.

Here is the copy/paste it won’t work but as requested

entities:
  - entity: sensor.cpu_temp
  - entity: binary_sensor.rpi_undervolt
  - entity: binary_sensor.rpi_has_undervolt
  - entity: binary_sensor.rpi_throttled
  - entity: binary_sensor.rpi_has_throttled
  - entity: binary_sensor.rpi_frequency_capped
  - entity: binary_sensor.rpi_has_frequency_capped
  - entity: binary_sensor.rpi_softlimit
  - entity: binary_sensor.rpi_has_softlimit
  - entity: sensor.disk_use_percent
  - entity: sensor.load_15m
  - entity: sensor.processor_use
  - entity: sensor.memory_free
  - entity: sensor.memory_use
  - entity: sensor.memory_use_percent
  - entity: sensor.network_in_eth0
  - entity: sensor.network_out_eth0
  - entity: sensor.time_online
  - entity: sensor.last_boot
show_header_toggle: false
title: Raspberry Pi System Status
type: entities

can you share the code that created those rpi_* sensors :slight_smile:

Yes but please remember the following:-

You need it insert the IP address of your home assistant server and create and insert a Long-Lived Access Token from the users page.
I don’t think it will work on HASSIO as I believe it does not have the vcgencmd command. Although I think I read the was a docker that has that command (you will have to research) the will probably other issues with HASSIO but I don’t use it so your on your own.
It assumes that you have HTTPS and use standard port 8123 if not then you will have to amend the code to suit.
You need to create a executable file and set up a cron job to run every minute. Don’t ask me how that’s what google is for.
It does work, if you can’t get it to work it’s something you have done.
Good luck and let me know if you get it working.

#!/bin/bash
SERVER='xxx.xxx.xxx.xxx:8123'
TOKEN='YOUR TOKEN HERE'

#Flag Bits
UNDERVOLTED=0x1
CAPPED=0x2
THROTTLED=0x4
SOFT_TEMPLIMIT=0x8
HAS_UNDERVOLTED=0x10000
HAS_CAPPED=0x20000
HAS_THROTTLED=0x40000
HAS_SOFT_TEMPLIMIT=0x80000

#Get Status, extract hex
STATUS=$(vcgencmd get_throttled)
STATUS=${STATUS#*=}

#Undervolted
((($STATUS&UNDERVOLTED)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "Undervoltage", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_undervolt || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:shield-check", "friendly_name": "Undervoltage", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_undervolt

#Has Undervolted
((($STATUS&HAS_UNDERVOLTED)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "Undervoltage Since Boot", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_undervolt || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:shield-check", "friendly_name": "Undervoltage Since Boot", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_undervolt

#Throttled
((($STATUS&THROTTLED)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "CPU Throttled", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_throttled || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:speedometer", "friendly_name": "CPU Throttled", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_throttled

#Has Throttled
((($STATUS&HAS_THROTTLED)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "CPU Throttled Since Boot", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_throttled || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:speedometer", "friendly_name": "CPU Throttled Since Boot", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_throttled

#Frequency Capped
((($STATUS&CAPPED)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "Frequency Capped", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_frequency_capped || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:speedometer", "friendly_name": "Frequency Capped", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_frequency_capped

# Has Frequency Capped
((($STATUS&HAS_CAPPED)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "Frequency Capped Since Boot", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_frequency_capped || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:speedometer", "friendly_name": "Frequency Capped Since Boot", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_frequency_capped

#Softlimit
((($STATUS&SOFT_TEMPLIMIT)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "Softlimit", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_softlimit || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:speedometer", "friendly_name": "Softlimit", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_softlimit

#Has Softlimit
((($STATUS&HAS_SOFT_TEMPLIMIT)!=0)) && \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:alert-circle", "friendly_name": "Softlimit Since Boot", "device_class": "problem"}, "state": "'on'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_softlimit || \
curl -k -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d \
'{"attributes": {"icon": "mdi:speedometer", "friendly_name": "Softlimit Since Boot", "device_class": "problem"}, "state": "'off'"}' https://${SERVER}/api/states/binary_sensor.rpi_has_softlimit

Does anyone have an answer to this question?

1 Like

If I am understanding your question correctly, yes you would need to flash a new SD card for HASSIO to be used on a Raspberry Pi 4. It is per device (I think that is what you are asking) based on the hardware found here: https://www.home-assistant.io/hassio/installation/ . If that is not what you are asking please clarify. From the link you provided you would need to scroll mostly to the bottom and look for file like “hassos_rpi4-3.5.img.gz” (note the rpi4 reference in that file name). Me personally, I am going from a raspberry pi 3 to a 4 so I will need to flash a new sd card and upload some of my backup.

hi jake, are you using the 32 or 64 bit version on the pi4? I have pi4 sitting on my tablet waiting to install hassio.

Ive tried Hassbian on the pi4 and had issues. Hass.io is supposed to be for beginners but the procedure is all over the place. I digress. 2 questions for you. 1- Which buster version did you use? Also, my primary goal is to run nodemcu esp8266 products on this. 2- Have you done anything with those? I had issues trying to load them on Hassbian. Yaml would not upload or even compile. I updated some of the python scripts and had to debug one to get back where I was. No compile.

Sorry for the diatribe. Just the 2 answers is good.

I was one of the first users who downloaded an flashed through beta version for the Pi4.
Now the downloadlink changed from beta to RC.

I‘m asking if the beta version is able to update itself via the hassio system section to the newest version or if we need to reflash the RC.

Maybe @petro is able to answer this?

:man_shrugging: Don’t use raspberry pi!

1 Like

I’ve had high temperatures even with a heatsink on the cpu so I’ve ordered a case with a fan. Its suuuuper loud on 5v, but you can barely hear it on 3.3v. Cpu temp sits at 38C now

Raspberry Pi 4 4GB working with no problem…

Running via SD card and via MySQL database on my NAS…

1 Like

Raspberry pi 4 works great, i’m just having issues with high load/io times. Dont know if is because i’ve had the same system running pn my old nuc before or maybe my sd card is too slow (using rpi4 only for testing).
P.s.
Lepo videt, da nas je nekaj it slo gor :slight_smile:

Change SD card… it must be class 10… if problem still persists then there is some other configuration problem…

Personal to slovenc: Se strinjam…

Do you know someone who could know the answer to this?