--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/db0db811-94ac-4762-ad31-9eb39b561bb9%40googlegroups.com.
In
[Engine]
[[Services]]
data_services = user.cputemp.AddCpuTemp
# Copyright (c) 2009-2020 Mike Revitt
# See the file LICENSE.txt for your rights.
"""Gets the CPU temperature on a Rasberry Pi"""
import weewx
from weewx.engine import StdService
from gpiozero import CPUTemperature
class AddCpuTemp(StdService):
def __init__(self, engine, config_dict):
# Initialize my superclass first:
super(AddCpuTemp, self).__init__(engine, config_dict)
# Bind to any new archive record events:
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
def new_archive_record(self, event):
cpu = CPUTemperature()
if event.record['usUnits'] == weewx.US:
event.record['extraTemp1'] = ( cpu.temperature * 1.8 ) + 32
else:
event.record['extraTemp1'] = cpu.temperature
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/368a7cda-13db-4d7c-a11a-48449d9eb48f%40googlegroups.com.
We'd have to see the code you're running to look at it in detail.Where did you get 'cputemp.py' and how can we get a look at the exact version you're running ?FWIW - you check the temperature on a pi by running "vcgencmd measure_temp" which reads the right thing under /proc and formats it for output
On Thursday, November 12, 2020 at 3:19:45 PM UTC-8 kdch...@gmail.com wrote:
Ok, I am not familiar with Python at all. I managed to work through the instructions above and make the changes to my weewx.conf file and then create cputemp.py in my /usr/share/weewx/user directory. This eliminated the errors in the my syslog. I am not seeing the cpu temp on the charts. How would I look up the variables in python to see if they are registering at all.
You can then access the Rasberry Pi CPU temperature as the variable extraTemp1 from within your HTML files
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/Iny0WMj78cU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/8a08f5b0-73be-43ff-aaca-0ec102e5aa2dn%40googlegroups.com.
Sorry it has taken so long to respond to this, but I have just finished documenting how I added the CPU Temperature to my website, this is all documented here https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/read-cpu-temp.html
Mike Revitt
Database Migration Specialist – Database Freedom
Amazon Web Services
e: revi...@amazon.com | p: +44.7825.063.466| w: aws.amazon.com

To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CACwjpb3uUd5jPmH5yfBsce7eBHkKQs0dSGCDcz2oWkA4ZQiD1w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/01000176a411f147-ab84b349-b443-4c80-b74a-314a7b48fd3e-000000%40email.amazonses.com.
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/6B658B72-0127-4CA6-BC85-60A52CB0A9E7%40gmail.com.