Skip to content

Instantly share code, notes, and snippets.

@hersche
Created June 20, 2017 10:15
Show Gist options
  • Save hersche/d3793ddd5ae9522afc5c7871cd7ea001 to your computer and use it in GitHub Desktop.
Save hersche/d3793ddd5ae9522afc5c7871cd7ea001 to your computer and use it in GitHub Desktop.
getting and logging rpi3 temp in hass
import os
fo = os.popen('vcgencmd measure_temp').read()
print(fo.split("=")[1].replace("'C\n",""))
# config for hass
sensor:
- platform: command_line
command: sudo -u mycroft python /usr/bin/piTemp.py
unit_of_measurement: "C (CPU)"
name: "Raspberry Temp"
scan_interval: 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment