livehouse-automation / veraflux

Vera Plugin to send device data to InfluxDB
4 stars 0 forks source link

Adding ZWaveDevice1 #20

Open tomtcom opened 3 years ago

tomtcom commented 3 years ago

Hello, all variables log fine. Current set up is CollectD on Vera, Influx on Pi, and Grafana on Pi for the dashboard. According to the readme, I'm supposed to edit the implementation file to update what gets logged to Influx but there's nothing in that file to indicate so I'm looking in L_VeraFlux1.lua.

Issue: ZWaveDevice1 never shows up in measurements for Grafana. I also attempted to add "Neighbors" and define the local ZWAVE_SID. Please note I'm not a programmer, just a tinkerer.

I added the last line: local VERAFLUX_SID = "urn:livehouse-automation:serviceId:VeraFlux1" local SWITCH_SID = "urn:upnp-org:serviceId:SwitchPower1" local SECURITY_SID = "urn:micasaverde-com:serviceId:SecuritySensor1" local HADEVICE_SID = "urn:micasaverde-com:serviceId:HaDevice1" local GATEWAY_SID = "urn:micasaverde-com:serviceId:HomeAutomationGateway1" local ZWAVE_SID = "urn:micasaverde-com:serviceId:ZWaveDevice1"

I then added Neighbors and reloaded luup and restarted CollectD but nothing shows up for health ever or neighbors. servicesTable['urn:micasaverde-com:serviceId:ZWaveDevice1'] = {} servicesTable['urn:micasaverde-com:serviceId:ZWaveDevice1']['fields'] = {"Health", "Neighbors"} servicesTable['urn:micasaverde-com:serviceId:ZWaveDevice1']['watchedFields'] = {} servicesTable['urn:micasaverde-com:serviceId:ZWaveDevice1']['tags'] = {"ConfiguredName","MeterType"}

This is what I get still in Grafana: 2021-01-21 18_39_45-Vera Z-Wave Framework - Grafana 2021-01-21 18_39_58-Vera Z-Wave Framework - Grafana

tomtcom commented 3 years ago

Apologies, I now see Issue 3. But reading through the entire XML implementation file I have no idea how this translates to what is recorded in the L_VeraFlux1.lua file. Lol, forgive me.

tomtcom commented 3 years ago

Hoping someone could assist here. :)

antonywinn commented 3 years ago

Ok, firstly Health doesn't seem to be a variable that gets used. It's in some of the old Vera luup documentation, but nothing has a value in the real world.

As for neighbors, That's not a single value suitable for injection into influxdb as is. It looks like this:

1,5,6,7,9,10,11,14,17,18,19,20,21,22,25,26,27,29,32,33,34,36,42,48,55,56,57,60,62,70,71,81,83,84,89,90,91,97,107,109,112,130,133,137,140,144,154,157,159,160,161,162,166,168,170,192,194,229,

Influx is expecting a single value per field and the comma's in the string will create some delimiter headaches. I suspect this would require specific coding in the lua module to process this string and break it into single values.

tomtcom commented 3 years ago

Thank you. I didn't think of that. So in theory any other variable with a single.value should work?

Do I need to specify local sid?

I'll give it a shot and try again with another variable of interest.

I appreciate your time!

tomtcom commented 3 years ago

Worked like a champ. Thank you.

I must have been so focused on a few variables I didn't try others. Thanks again.

2021-02-06 14_03_08-Vera Z-Wave Framework - Grafana

tomtcom commented 3 years ago

Can I ask that words be accepted versus just numbers? After reviewing your response about neighbors, I don't think I can leverage HVAC modestatus. This would tell me the AC is on/off etc.

servicesTable['urn:upnp-org:serviceId:HVAC_UserOperatingMode1'] = {} servicesTable['urn:upnp-org:serviceId:HVAC_UserOperatingMode1']['fields'] = {"ModeStatus"} servicesTable['urn:upnp-org:serviceId:HVAC_UserOperatingMode1']['watchedFields'] = {} servicesTable['urn:upnp-org:serviceId:HVAC_UserOperatingMode1']['tags'] = {}

2021-02-10 19_45_51-Window 2021-02-10 19_55_27-