i have a door switch that gives 1 or 0. I get the data from an API. For any reason my code below does not work as expected:
If value from door switch API = 1 and dummy switch == on, then set dummy switch Off
If value from door switch API = 0 and dummy switch == off, then set dummy switch On
Code: Select all
if (tuergartenhaus == '1' and otherdevices['Tür Gartenhaus'] == 'On') then
commandArray['Tür Gartenhaus'] = 'Off'
end
if (tuergartenhaus == '0' and otherdevices['Tür Gartenhaus'] == 'Off') then
commandArray['Tür Gartenhaus'] = 'On'
end