I recently got one of the new RFXCom LAN transceivers in the mail, and it's proving itself as a fantastic bit of kit:)
There are a few issues I've been having with the plugin though, which I thought I'd mention so someone a bit more competent in Python might have a look at them:)
Firstly I had a hard time getting it to respond to any xPL-commands issued from EG at all. I managed to sort this out in the end by changing the XPL-reporting name in the plugin. Also it wouldn't respond to any xPL-messages sent directly to the RFXCom. The latter issue I still haven't nailed down. I think the first issue may have been caused by the EG xPL-name being too long, as anything short seemed to work fine - am I right in this? I saw somewhere a reference to xPL wanting reporting names of 8 characters or less?
The second issue is a little less of a showstopper, but a bit tricky - I have through trial and error had to write my own parser that spits out events on incoming sensor messages from a bunch of Oregon Scientific sensors. There might be an easier way to do this, but I haven't figured out any useful way of defining wildcards in events, so when a sensor sends an xPL-command, it will look something like:
Code: Select all
xPL.xpl-trig:sensor.basic:rfxcom-lan.0004a31bb683:*:device=th1 0xcc01,type=humidity,current=51,description=comfort,Code: Select all
Main.humidity.Temp/Hygro1 [b]'51'[/b]Code: Select all
sensorcall_payload = eg.EventString
sensorcall_list = sensorcall_payload.split(":")
sensorcall_type = sensorcall_list[1]
def sensors():
return collections.defaultdict(sensors)
#if sensorcall_type == "sensor.basic" :
sensorcall_data = sensorcall_list[-1].split(",")
if sensorcall_data[0] <> "" :
sensor_name = sensorcall_data[0].split("=")
if sensorcall_data[1] <> "" :
sensor_type = sensorcall_data[1].split("=")
if sensorcall_data[2] <> "" :
sensor_data = sensorcall_data[2].split("=")
if sensorcall_data[3] <> "" :
sensor_more = sensorcall_data[3].split("=")
eg.sensors.setdefault(sensor_name[1], {}).setdefault(sensor_type[1], {})[sensor_data[1]] = sensor_more[1]
else :
eg.sensors.setdefault(sensor_name[1],{})[sensor_type[1]] = sensor_data[1]
print sensorcall_data[0]
print sensorcall_data[1]
print sensorcall_data[2]
if sensorcall_data[3] <> "" :
print sensorcall_data[3]
if sensor_name[1] == "th1 0xcc01" :
if sensor_type[1] == "temp" :
eg.TriggerEvent("temperature.Temp/Hygro1",sensor_data[1])
if sensor_type[1] == "humidity" :
eg.TriggerEvent("humidity.Temp/Hygro1",sensor_data[1])
if sensor_type[1] == "battery" :
eg.TriggerEvent("battery.Temp/Hygro1",sensor_data[1])
if sensor_name[1] == "th1 0xee02" :
if sensor_type[1] == "temp" :
eg.TriggerEvent("temperature.Temp/Hygro2",sensor_data[1])
if sensor_type[1] == "humidity" :
eg.TriggerEvent("humidity.Temp/Hygro2",sensor_data[1])
if sensor_type[1] == "battery" :
eg.TriggerEvent("battery.Temp/Hygro2",sensor_data[1])
if sensor_name[1] == "temp1 0x1" :
if sensor_type[1] == "temp" :
eg.TriggerEvent("temperature.Temp1",sensor_data[1])
if sensor_type[1] == "battery" :
eg.TriggerEvent("battery.Temp1",sensor_data[1])
if sensor_name[1] == "uv1 0x1400" :
if sensor_type[1] == "uv" :
eg.TriggerEvent("UV.UV1",sensor_data[1])
if sensor_type[1] == "battery" :
eg.TriggerEvent("battery.UV1",sensor_data[1])I think this would be made easier, although it would probably still require some scripted parsing, if the plugin parsed sensor data and sent it as a payload, maybe something like (payload in bold):
Code: Select all
xPL.xpl-trig:sensor.basic:rfxcom-lan.0004a31bb683:* [b]'device=th1 0xcc01,type=humidity,current=51,description=comfort,'[/b]Code: Select all
xPL.xpl-trig:sensor.basic:rfxcom-lan.0004a31bb683:*:'device=th1 0xcc01,type=humidity [b]',current=51,description=comfort,'[/b]Hope this is helpful, and thank you again for your work:)