if not time then time = os.date(payload['time']); end
local model = payload['model']
local id = payload['id']
payload = json.decode(payload)
local time = os.date(payload['Time'])
if not time then time = os.date(payload['time']); end
local model = payload['model']
local id = payload['id']
+ if not model then
+ device = payload['device']
+ if device then
+ model = device['model']
+ id = device['ieeeAddr']
+ end
+ end
for sensor_type,sensor_data in pairs(payload) do
for sensor_type,sensor_data in pairs(payload) do
- if sensor_type ~= "Time" and sensor_type ~= "TempUnit" and sensor_type ~= "model" and sensor_type ~="id" and sensor_type ~= "time" then
+ if sensor_type ~= "Time" and sensor_type ~= "TempUnit" and sensor_type ~= "model" and sensor_type ~="id" and sensor_type ~= "time" and sensor_type ~= "device" and sensor_type ~="linkquality" and sensor_type ~= "battery" and sensor_type ~= "last_seen" and sensor_type ~= "voltage" then