Update last seen time domoticz

Post Reply
pesa1234
Posts: 5
Joined: Wednesday 05 December 2018 12:58
Target OS: Raspberry Pi
Domoticz version:
Contact:

Update last seen time domoticz

Post by pesa1234 » Wednesday 05 December 2018 19:02

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
}

pesa1234
Posts: 5
Joined: Wednesday 05 December 2018 12:58
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Update last seen time domoticz

Post by pesa1234 » Sunday 16 December 2018 3:27

Solved, changed script with auto update of setpoint

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest