Page 1 of 1

Update last seen time domoticz

Posted: Wednesday 05 December 2018 18:02
by pesa1234
Hi ,
I have a question:
Is there a possibility in domoticz to update last seen time of a thermostat setpoint to prevent it to blink in red in the GUI?

I would like to update just the time not the status, otherwise the script to control my Air Conditioner send command without do anything.

This is my script to control my AC:

Code: Select all

return {
   on = {
      devices = {'AC Mode','AC Temp'},
   },
   execute = function(domoticz, device)
      
      local mytemp = domoticz.devices('AC Temp')
      
      local ip = '192.168.181.177'
      
      if ((device.name == 'AC Mode' and device.changed) or
         (device.name == 'AC Temp' and device.changed)) then
        --domoticz.log('Device ' .. device.name .. ' ' ..device.state.. ' was changed', domoticz.LOG_INFO)  
        if (device.name == 'AC Mode' and device.state == 'Off') then
            domoticz.openURL('http://' ..ip.. '/off')
            domoticz.log('http://' ..ip.. '/off', domoticz.LOG_INFO)
            domoticz.log('SPENTO', domoticz.LOG_INFO)
        end
        if (device.name == 'AC Mode' and device.state == 'Auto') then
            domoticz.openURL('http://' ..ip.. '/auto?temp='..(mytemp.state)..'')
            domoticz.log('http://' ..ip.. '/auto?temp='..(mytemp.state)..'', domoticz.LOG_INFO)
            domoticz.log('ACCESO AUTO', domoticz.LOG_INFO)
        end
        if (device.name == 'AC Mode' and device.state == 'Caldo') then
            domoticz.openURL('http://' ..ip.. '/caldo?temp='..(mytemp.state)..'')
            domoticz.log('http://' ..ip.. '/caldo?temp='..(mytemp.state)..'', domoticz.LOG_INFO)
            domoticz.log('ACCESO CALDO', domoticz.LOG_INFO)
        end
        if (device.name == 'AC Mode' and device.state == 'Freddo') then
            domoticz.openURL('http://' ..ip.. '/freddo?temp='..(mytemp.state)..'')
            domoticz.log('http://' ..ip.. '/freddo?temp='..(mytemp.state)..'', domoticz.LOG_INFO)
            domoticz.log('ACCESO FREDDO', domoticz.LOG_INFO)
        end
        if (device.name == 'AC Mode' and device.state == 'Dry') then
            domoticz.openURL('http://' ..ip.. '/deu')
            domoticz.log('http://' ..ip.. '/deu', domoticz.LOG_INFO)
            domoticz.log('ACCESO DEUMIDIFICATORE', domoticz.LOG_INFO)
        end
        if (device.name == 'AC Temp' and device.changed) then
            local mysetup = domoticz.devices('AC Mode')
            if mysetup.state == 'Auto' then
            domoticz.openURL('http://' ..ip.. '/auto?temp='..(mytemp.state)..'')
            domoticz.log('http://' ..ip.. '/auto?temp='..(mytemp.state)..'', domoticz.LOG_INFO)
            domoticz.log('ACCESO AUTO_TEMPVAR', domoticz.LOG_INFO)
            end
    end
            if (device.name == 'AC Temp' and device.changed) then
            local mysetup = domoticz.devices('AC Mode')
            if mysetup.state == 'Caldo' then
            domoticz.openURL('http://' ..ip.. '/caldo?temp='..(mytemp.state)..'')
            domoticz.log('http://' ..ip.. '/auto?temp='..(mytemp.state)..'', domoticz.LOG_INFO)
            domoticz.log('ACCESO CALDO_TEMPVAR', domoticz.LOG_INFO)
            end
    end
            if (device.name == 'AC Temp' and device.changed) then
            local mysetup = domoticz.devices('AC Mode')
            if mysetup.state == 'Freddo' then
            domoticz.openURL('http://' ..ip.. '/freddo?temp='..(mytemp.state)..'')
            domoticz.log('http://' ..ip.. '/freddo?temp='..(mytemp.state)..'', domoticz.LOG_INFO)
            domoticz.log('ACCESO FREDDO_TEMPVAR', domoticz.LOG_INFO)
            end
        end
    end
end
}

Re: Update last seen time domoticz

Posted: Sunday 16 December 2018 2:27
by pesa1234
Solved, changed script with auto update of setpoint