Update device without triggering further events
Posted: Monday 10 July 2017 20:32
I'm using a script to poll my Daikin airco unit to retrieve the settings from it. Those values are sent to the different target setpoint and selector switches. Those in turn trigger a device event which will send the values to the airco unit. This gives some undesired side effects.
Is there a way to update a device and not trigger any further events?
The devices in question are a selector switch, thermostat and light switch.
I set the values the following way:
Setting light switch:
commandArray[deviceName] = '' .. targetValue
Setting selector switch:
commandArray[deviceName] = 'Set Level: ' .. targetPercentage
Setting thermostat:
commandArray['UpdateDevice'] = '' .. deviceIdx .. '|0|' .. targetValue
The script which sends the settings to the airco unit starts with:
if (devicechanged['Slaapkamer Mode']) or (devicechanged['Slaapkamer Target']) or (devicechanged['Slaapkamer FRate'])
... do stuff ....
send settings to airco using curl
end
To summarize: I want the last event script not to trigger or a way to detect the settings have been changed from outside (not from the UI). Is this possible?
Is there a way to update a device and not trigger any further events?
The devices in question are a selector switch, thermostat and light switch.
I set the values the following way:
Setting light switch:
commandArray[deviceName] = '' .. targetValue
Setting selector switch:
commandArray[deviceName] = 'Set Level: ' .. targetPercentage
Setting thermostat:
commandArray['UpdateDevice'] = '' .. deviceIdx .. '|0|' .. targetValue
The script which sends the settings to the airco unit starts with:
if (devicechanged['Slaapkamer Mode']) or (devicechanged['Slaapkamer Target']) or (devicechanged['Slaapkamer FRate'])
... do stuff ....
send settings to airco using curl
end
To summarize: I want the last event script not to trigger or a way to detect the settings have been changed from outside (not from the UI). Is this possible?