Events from Xiaiomi devices
Posted: Friday 28 February 2020 9:00
I have just started trying a Xiomi Gateway, and the only device I have been testing so far is a temperature / humidity sensor. This seems to work, though it looks like the reading are sometimes missing for shorter or longer periods.
I want to be able to send information using MQTT, which means I have to get information from for example:
IDX Hardware ID Unit Name Type Sub Type Value
10 Xiaomi AD55 85 Temperatur Ute Temp LaCrosse TX3 16.9 C
9 Dummy 0014059 1 Termostat Ute Thermostat SetPoint 16.5
The second entry is for a thermostat setting, and I pick up information using dzVents like this;
If I use domoticz/out I will get a text string, which I manipulate using the string object in Node Red.
I would like to read the information the same way from the Xiaomi device, but I'm not sure how to do this.
Can someone help me, please?
Best regards
Ulf
I want to be able to send information using MQTT, which means I have to get information from for example:
IDX Hardware ID Unit Name Type Sub Type Value
10 Xiaomi AD55 85 Temperatur Ute Temp LaCrosse TX3 16.9 C
9 Dummy 0014059 1 Termostat Ute Thermostat SetPoint 16.5
The second entry is for a thermostat setting, and I pick up information using dzVents like this;
Code: Select all
return {
on = { timer = { 'every minute' } },
execute = function(domoticz)
local Sensor = domoticz.devices(10) -- Temperature
local SETPOINT = domoticz.devices(9) -- SetPoint
SETPOINT.updateSetPoint(SETPOINT.setPoint) -- This will refresh the setPoint with current value
if (Sensor.temperature <= (SETPOINT.setPoint - 0.2)) then -- turn on heat
domoticz.devices(14).switchOn().checkFirst()
elseif (Sensor.temperature >= (SETPOINT.setPoint + 0.2)) then -- turn off heat
domoticz.devices(14).switchOff().checkFirst()
else
-- within hysteresis range
end
end
}
I would like to read the information the same way from the Xiaomi device, but I'm not sure how to do this.
Can someone help me, please?
Best regards
Ulf