Page 1 of 1
Update device with no trigger stopped working - Dzvents
Posted: Thursday 12 October 2017 11:01
by Milifax
Hi all,
In my Dzvents sctipt I used this line to update a sw switch to an on state without really triggering it. The switch is used in another script, so I needed to update it in script #1 without setting it of in script #2.This was working great.
Code: Select all
domoticz.devices('Huiskamer Lampen').update(1,1)
However, I now updated to v3.8564 of Domiticz and the funciton seems to not work anymore. Instead it does trigger the script #2.
Has anything changed on this issue with a new Dzvents version maybe?
Thanks in advance
Re: Update device with no trigger stopped working - Dzvents
Posted: Thursday 12 October 2017 12:48
by emme
domoticz.devices('Huiskamer Lampen').update(1,1).silent()
maybe?
Re: Update device with no trigger stopped working - Dzvents
Posted: Thursday 12 October 2017 20:45
by Milifax
emme wrote: ↑Thursday 12 October 2017 12:48
domoticz.devices('Huiskamer Lampen').update(1,1).silent()
maybe?
Thanks for pointing that out to me.
The command
Code: Select all
domoticz.devices('Huiskamer Lampen').switchOn().silent()
works. It switches to the on-state but doesn't execute any other scripts. Great!
Re: Update device with no trigger stopped working - Dzvents
Posted: Friday 13 October 2017 10:41
by dannybloe
Yes, that's new functionality. I deliberately made it so that a followup event is always issued unless you use the silent() option. Just to make things more predictable and controllable.
Re: Update device with no trigger stopped working - Dzvents
Posted: Wednesday 03 January 2018 6:50
by Wob76
Hi,
@dannybloe
It appears that the .silent() option only suppresses Dzvents? Is there a way to action a switch and have it not trigger events in Domoticz, I am particularly interested in MQTT. I tired silent but the device still triggers a MQTT message
I have "Light Groups" I want to turn on when any 1 bulb in the group is on and off if all bulbs are off, but I don't want a MQTT message to be sent as the Group MQTT message will turn off\on all the lights in that group via the light control hub.
I am trying to simulate the same functionality as the manufactures phone app, but finding it tricky, the master\slave switch function in domoticz doesn't seem to suit, or at least I can't work it out in a way that suits.
Thanks,
Wob
Re: Update device with no trigger stopped working - Dzvents
Posted: Wednesday 03 January 2018 10:16
by dannybloe
The .silent() function only tells Domoticz not to trigger follow-up events in the event-system. This doesn't effect anything else. So if you have a group with switches and you switch the group silently, then the switches will be affected. The event-system isn't triggered though. And I think it should be like this.
If you want to have more control then use a dzVents script to control your groups. In the upcoming dzVents 2.4 you will get a list of devices that are in your group so you can manipulate them in your scripts. For now you will have to make a list of group members in your script and use that to switch them. But you can create a group-trigger quite easily:
Code: Select all
return {
on = {
groups = { 'myGroup' }
},
...
}
Re: Update device with no trigger stopped working - Dzvents
Posted: Wednesday 03 January 2018 12:02
by Wob76
Hi,
Thanks for the response, My "Groups" are not Domoticz groups per say, they are just extra Dummy Light Switches, but they operate the "Group" as defined on the light hub, I prefer to use these groups as the lights are more in-sync than if I operate each light via a script.
The light hub doesn't report a on\off state, or level for the group, only each bulb, and creating a "group" in nodered (I am using that to talk to the hub) is proving difficult.
I created a script to update the group to ON\OFF only when ALL member lights where ON\OFF, and thought this would be OK As the MQTT would only tell the hub to turn to the state it is already in, but this caused some unpredictable behavior, lights turning on\off unexpectedly. So I would like to update the switch but suppress the MQTT message, there was a LUA script (
https://www.domoticz.com/forum/viewtopi ... 38&t=19217) that does something similar, but it didn't really scale to the number of devices I have, so I was hoping to do it via the silent option in dzvents, but even with that on my dummy switch I am still seeing the MQTT message when the dummy switch changes, so it must be outside the event system?
Re: Update device with no trigger stopped working - Dzvents
Posted: Tuesday 09 January 2018 2:51
by Wob76
I found a solution to my problem by creating a slave switch, i can now action the slave switch via dzVents or MQTT and it will not cause a outgoing MQTT message for the master switch.