CPU Temperature trigger


is it possible to create a trigger to notify when the CPU temperature goes above a certain value?
Thank you, regards.


  1. Install gpiozero module pip install gpiozero
  2. See if you get cpu temperature reading using this python code:
from gpiozero import CPUTemperature

cpu = CPUTemperature()
  1. Next, use cayenne python module https://github.com/myDevicesIoT/Cayenne-MQTT-Python to send the cpu temperature to cayenne.
  2. You will need to use https://github.com/myDevicesIoT/Cayenne-MQTT-Python/blob/master/examples/Example-04-SendDataOnTrigger.py example to send data for using trigger feature.
  3. Once done, add trigger to the two state widget.

Thanks Shramik, I will try it.


1 Like

Do not create multiple topic on same issue. You can continue here.
CPU temperature are default widget are added when the raspberry is added. All default widget do not have history data and hence will not show on chart.

I thought it was a different topic even if it has the same subject…ok.
So, how could I have a CPU temp. graph, if possible?
Should I have to send CPU temp. data through Python and MQTT in a similar way like the solution for the trigger in the above post?