Page 1 of 1

First DzVents doesn't work yet

Posted: Saturday 25 April 2020 21:14
by wouterlet
Hi Guys,

I started with my first DzVents since Blocky did unexpected actions. But I can't get it working yet.
Is there someone who can help?

I have a push button "Button Eettafel", that gives a state "Group off" when it's pushed
I want to switch on and off a FGD-212 "Light Eettafel"

Code: Select all

return {

   on = { devices = { "Button Eettafel" }},        -- Name of your button
               
   execute = function(dz, item )
        if item.state == "Group off" then
            dz.devices("Light Eettafel").toggleSwitch()    -- Name of your Yeelight
        end
   end
}
My log says:

2020-04-25 21:12:55.076 Status: dzVents: Info: Handling events for: "Button Eettafel", value: "Group Off"
2020-04-25 21:12:55.076 Status: dzVents: Info: ------ Start internal script: Script #1: Device: "Button Eettafel (RFXCom)", Index: 258
2020-04-25 21:12:55.076 Status: dzVents: Info: ------ Finished Script #1

But the light isn't working.
Hope you can help!

Best regards,

Wouter Lettinga

Re: First DzVents doesn't work yet  [Solved]

Posted: Saturday 25 April 2020 22:12
by waaren
wouterlet wrote: Saturday 25 April 2020 21:14 if item.state == "Group off" then
2020-04-25 21:12:55.076 Status: dzVents: Info: Handling events for: "Button Eettafel", value: "Group Off"
String comparison is case sensitive. Your button has state 'Group Off' but you check for 'Group off'.
That will not evaluate to true.

Re: First DzVents doesn't work yet

Posted: Sunday 26 April 2020 20:56
by wouterlet
Wow thanks, that was all. I really have te be precise with this. It works now, Thanks!