Strange, as you say for humidity this does not seem to work correctly as it does for energy meters.
I created a dummy humidity device 'DummyHumidity', then wrote a simple time test script - checking the web humidity display all seems to work fine, the humidity is change to 32% as set with 1 being it is comfortable, the last updated is always less than 1 minute ago as the time script is executed every minute and the devices pages shows the updated time.
However in the script I have 3 issues:
1. otherdevices_humidity['DummyHumidity'] returns nil, not the humidity value, what am I doing wrong?
2. otherdevices_svalues['DummyHumidity'] returns 50% always
3. otherdevices_lastupdate['DummyHumidity'] does not change and so is a time unrelated to that displayed on the web page.
Code: Select all
-- ~/domoticz/scripts/lua/device_time_humidity.lua
commandArray = {}
print('Humidity Script')
hum4 = otherdevices_svalues['DummyHumidity']
-- hum4 = otherdevices_humidity['DummyHumidity']
print('Humidity '..hum4)
print(otherdevices_lastupdate['DummyHumidity'])
commandArray[1] = {['UpdateDevice'] = 417 .. "|32|" .. 1}
return commandArray
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266