More options to trigger devices

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
alexkoel
Posts: 2
Joined: Wednesday 18 November 2020 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

More options to trigger devices

Post by alexkoel »

It would be great if it was possible to trigger a device on a status or value of another device.
e.g. Blinds closes when the sun sensor is above a specific value, bathroom fan activates when humidity reaches a certain level, spot on the driveway activates when PIR senses moving during the night, etc.

I know you can do a lot with scripting, but I found out that the most easy one (dzvents) has his strange behaviors. It is also not userfriendly for people who are not familiar with scripting.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: More options to trigger devices

Post by waaren »

alexkoel wrote: Wednesday 18 November 2020 21:03 but I found out that the most easy one (dzvents) has his strange behaviors.
Can you please elaborate on what you call "strange behaviors"
I might be able to explain / clarify.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
alexkoel
Posts: 2
Joined: Wednesday 18 November 2020 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: More options to trigger devices

Post by alexkoel »

I copied a very simple script and adjust it to my needs. It switched a light on when temerature was below 14 degrees. It worked. I changed the light to a blind and I received "attempt to call a nil value (field 'SwitchOff'". I changed switchoff() to close(), same result. I changed back to the light. Fault persists. I wasn't able to make the script working.
Not working script below:

Code: Select all

return {
   on = {
       timer = { 'every minute'  } },
      
   execute = function(domoticz)
      local Sensor = domoticz.devices('Temp Druiven')
      if Sensor.temperature < 14 then
         domoticz.devices('SWD Staande lamp TV').SwitchOff()
      end
   end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: More options to trigger devices

Post by waaren »

alexkoel wrote: Wednesday 18 November 2020 23:17 I copied a very simple script and adjust it to my needs. It switched a light on when temerature was below 14 degrees. It worked. I changed the light to a blind and I received "attempt to call a nil value (field 'SwitchOff'". I changed switchoff() to close(), same result. I changed back to the light. Fault persists. I wasn't able to make the script working.
Case matters...

The method SwitchOff() does not exist. Try again and use switchOff()
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests