CPU Temperature trigger

Hi,

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

Roberto

  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()
print(cpu.temperature)
  1. Next, use cayenne python module GitHub - myDevicesIoT/Cayenne-MQTT-Python: Python Library for Cayenne MQTT API to send the cpu temperature to cayenne.
  2. You will need to use Cayenne-MQTT-Python/Example-04-SendDataOnTrigger.py at master · myDevicesIoT/Cayenne-MQTT-Python · GitHub example to send data for using trigger feature.
  3. Once done, add trigger to the two state widget.

Thanks Shramik, I will try it.
Regards,

Roberto

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?

Roberto

Yes.