Hi Matte,
i also tried a the 0.3 version of sdr driver.
i create a *classThermoSensorPacket(Packet)* similar to another pf you
example
class ThermoSensorPacket(Packet):
#2016-09-09 11:59:10 : Thermo Sensor THR228N
# House Code: 111
# Channel: 2
# Battery: OK
# Temperature: 24.70 C
IDENTIFIER = "Thermo Sensor THR228N"
PARSEINFO = {
'StationID': ['station_id', None, None],
'House Code': ['house_code', None, lambda x : int(x) ],
'Channel': ['channel', None, lambda x : int(x) ],
'Battery': ['battery', None, lambda x : 0 if x == 'OK' else 1],
'Temperature':
['temperature', re.compile('([\d.]+) C'), lambda x : float(x)]
# 'Humidity': ['humidity', re.compile('([\d.]+) %'), lambda x :
float(x)]
}
@staticmethod
def parse(ts, payload, lines):
pkt = dict()
pkt['dateTime'] = ts
pkt['usUnits'] = weewx.METRIC
pkt.update(Packet.parse_lines(lines, ThermoSensorPacket.PARSEINFO))
channel = pkt.pop('channel', 0)
code = pkt.pop('house_code', 0)
sensor_id = "%s:%s" % (channel, code)
pkt = Packet.add_identifiers(pkt, sensor_id,
ThermoSensorPacket.__name__)
return pkt
I also declare it in:
class SDRDriver(weewx.drivers.AbstractDevice):
[cut]
Packet.KNOWN_PACKETS = [
FOWH1080Packet,
AcuriteTowerPacket,
* ThermoSensorPacket,*
[cut]
and in debug options:
[cut]
Packet.KNOWN_PACKETS = [FOWH1080Packet,
AcuriteTowerPacket,
* ThermoSensorPacket,*
[cut]
I put this line in weewx.conf
# The diver to use
driver = user.sdr
cmd = /usr/local/bin/rtl_433
[[sensor_map]]...
* temperature.2:111.ThermoSensorPacket = outTemp*
because i read this linees in weewx.log
Sep 11 17:50:41 raspberrypi3 weewx[10623]: sdr: MainThread:
lines=['2016-09-11 17:50:41 :\tThermo Sensor THR228N\n', '\tHouse Code:\t
111\n', '\tChannel:\t 2\n', '\tBattery:\t OK\n', '\tTemperature:\t 27.60
C\n']
Sep 11 17:50:41 raspberrypi3 weewx[10623]: sdr: MainThread: ts=1473616241
payload=Thermo Sensor THR228N
Sep 11 17:50:41 raspberrypi3 weewx[10623]: sdr: MainThread: pkt={'
*temperature.2:111.ThermoSensorPacket'*: 27.6,
'battery.2:111.ThermoSensorPacket': 0, 'usUnits': 16, 'dateTime':
1473616241}
Sep 11 17:50:41 raspberrypi3 weewx[10623]: sdr: MainThread:
packet={'outTemp': 27.6, 'usUnits': 16, 'dateTime': 1473616241}
Sep 11 17:50:41 raspberrypi3 weewx[10623]: reportengine: Running reports
for latest time in the database.
After the first running in which in any case i don't see any variation in
weewx html page and in which i can see the packet of rtl_433 reading, I
receive this log message:
Sep 11 17:55:17 raspberrypi3 weewx[10623]: engine: Finished loading service
weewx.engine.StdReport
Sep 11 17:55:17 raspberrypi3 weewx[10623]: engine: Starting up weewx
version 3.5.0
Sep 11 17:55:17 raspberrypi3 weewx[10623]: engine: Station does not support
reading the time
Sep 11 17:55:17 raspberrypi3 weewx[10623]: engine: Starting main packet
loop.
Sep 11 17:55:17 raspberrypi3 weewx[10623]: sdr: MainThread: startup process
'/usr/local/bin/rtl_433'
Sep 11 17:55:27 raspberrypi3 weewx[10623]: sdr: MainThread: lines=[]
Sep 11 17:55:27 raspberrypi3 weewx[10623]: sdr: MainThread: err: []
Sep 11 17:55:27 raspberrypi3 weewx[10623]: engine: Main loop exiting.
Shutting engine down.
Sep 11 17:55:27 raspberrypi3 weewx[10623]: sdr: MainThread: shutdown process
Sep 11 17:55:27 raspberrypi3 weewx[10623]: *engine: Caught WeeWxIOError:
rtl_433 *process is not running
Sep 11 17:55:27 raspberrypi3 weewx[10623]: * **** Waiting 60 seconds
then retrying...*
and so on.
Any ideas? Regards, Stefano.
--
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].
For more options, visit https://groups.google.com/d/optout.