Open Sar6e opened 2 years ago
I recently purchased one of these sensors. The feed from running the driver returns
out: ['{"time" : "2022-06-30 09:48:01", "model" : "Esperanza-EWS", "id" : 198, "channel" : 2, "temperature_F" : 67.100, "humidity" : 0, "mic" : "CRC"}\n']
I've added the following to sdr.py
class EsperanzaEWSPacket(Packet):
# {"time" : "2022-06-30 08:29:25", "model" : "Esperanza-EWS", "id" : 198, "channel" : 2, "temperature_F" : 69.200, "humidity" : 0, "mic" : "CRC"} IDENTIFIER = "Esperanza-EWS" @staticmethod def parse_json(obj): pkt = dict() pkt['dateTime'] = Packet.parse_time(obj.get('time')) pkt['usUnits'] = weewx.US sensor_id = obj.get('id') pkt['temperature'] = Packet.get_float(obj, 'temperature_F') pkt['humidity'] = Packet.get_float(obj, 'humidity') pkt['channel'] = obj.get('channel') pkt = Packet.add_identifiers(pkt, sensor_id, EsperanzaEWSPacket.__name__) return pkt
The driver now seems to be parsing the sensor output OK now?
out: ['{"time" : "2022-06-30 09:48:01", "model" : "Esperanza-EWS", "id" : 198, "channel" : 2, "temperature_F" : 67.100, "humidity" : 0, "mic" : "CRC"}\n'] parsed: {'dateTime': 1656582481, 'usUnits': 1, 'temperature.198.EsperanzaEWSPacket': 67.1, 'humidity.198.EsperanzaEWSPacket': 0.0, 'channel.198.EsperanzaEWSPacket': 2}
I recently purchased one of these sensors. The feed from running the driver returns
out: ['{"time" : "2022-06-30 09:48:01", "model" : "Esperanza-EWS", "id" : 198, "channel" : 2, "temperature_F" : 67.100, "humidity" : 0, "mic" : "CRC"}\n']
I've added the following to sdr.py
class EsperanzaEWSPacket(Packet):
This is for a Esperanza-EWS temperature humidity sensor
The driver now seems to be parsing the sensor output OK now?
out: ['{"time" : "2022-06-30 09:48:01", "model" : "Esperanza-EWS", "id" : 198, "channel" : 2, "temperature_F" : 67.100, "humidity" : 0, "mic" : "CRC"}\n'] parsed: {'dateTime': 1656582481, 'usUnits': 1, 'temperature.198.EsperanzaEWSPacket': 67.1, 'humidity.198.EsperanzaEWSPacket': 0.0, 'channel.198.EsperanzaEWSPacket': 2}