Hi Gary, Thanks for this. It looks as if the device I have is either a knock-off of the original Prologue or a later version. I reckon creating an extra function will sort it, as there are a few irritating small differences between the messages that each pushes out. I'll have to familiarise myself with the GitHub workflow to pull & push changes to someone else's code.. I've also discovered that I can bodge a shellscript together that will pull the pressure off the simple webpage that the Acurite Atlas hub displays (why they didn't publish a JSON page with the data on the thing is beyond me...)
On Thu, 2 Sept 2021 at 13:50, gjr80 <[email protected]> wrote: > Unless you are using a modified version of the the SDR driver it should be > .ProloguePacket not .PrologueTHPacket. > > You will likely have to modify the SDR driver code (sdr.py circa line > 2278) as follows so that it will decode your Prologue sensor data: > > class ProloguePacket(Packet): > # 2017-03-19 : Prologue Temperature and Humidity Sensor > # {"time" : "2017-03-15 20:14:19", "model" : "Prologue sensor", "id" : > 5, "rid" : 166, "channel" : 1, "battery" : "OK", "button" : 0, > "temperature_C" : -0.700, "humidity" : 49} > > IDENTIFIER = "Prologue-TH" > > @staticmethod > def parse_json(obj): > pkt = dict() > pkt['dateTime'] = Packet.parse_time(obj.get('time')) > pkt['usUnits'] = weewx.METRIC > sensor_id = obj.get('rid') > pkt['temperature'] = Packet.get_float(obj, 'temperature_C') > pkt['humidity'] = Packet.get_float(obj, 'humidity') > pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1 > pkt['channel'] = obj.get('channel') > pkt = Packet.add_identifiers(pkt, sensor_id, > ProloguePacket.__name__) > return pkt > > > > Gary > > On Thursday, 2 September 2021 at 13:05:33 UTC+10 [email protected] > wrote: > >> Hi all, >> >> I'm attempting to pull data off two sources at once via the SDR driver - >> an Acurite (which works) and an el-cheapo device for the inside temperature >> & humidity which puts out packets that look like this: >> >> out:[u'{"time" : "2021-09-02 02:57:42", "model" : "Prologue-TH", >> "subtype" : 5, "id" : 70, "channel" : 3, "battery_ok" : 1, "temperature_C" >> : 22.300, "humidity" : 42, "button" : 0}\n', u'{"time" : "2021-09-02 >> 02:57:42", "model" : "TFA-TwinPlus", "id" : 10, "channel" : 1, "battery_ok" >> : 1, "temperature_C" : -25.100, "humidity" : 51, "mic" : "CHECKSUM"}\n'] >> >> In my [[sensor_map]] entries, I have for this device (Acurite stuff >> elided) >> >> inTemp = temperature_C.0046.PrologueTHPacket >> inHumidity = humidity.0046.PrologueTHPacket >> >> What am I doing wrong? >> > -- > 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/WE_o14sb8BE/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/a5fd73e3-d783-4118-af25-275dc294679an%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/a5fd73e3-d783-4118-af25-275dc294679an%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- "I and the public know what all schoolchildren learn Those to whom evil is done Do evil in return" W.H. Auden, "September 1, 1939" -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CA%2BxzKjD%3D1RODTjWa0CAYiw-36avAkcrUrfYgRyD-7MQAFgBEDA%40mail.gmail.com.
