Update device with no trigger stopped working - Dzvents

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Milifax
Posts: 69
Joined: Friday 23 June 2017 9:27
Target OS: Linux
Domoticz version: 2024.4
Location: The Netherlands
Contact:

Update device with no trigger stopped working - Dzvents

Post 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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post by emme »

domoticz.devices('Huiskamer Lampen').update(1,1).silent()

maybe?
The most dangerous phrase in any language is:
"We always done this way"
Milifax
Posts: 69
Joined: Friday 23 June 2017 9:27
Target OS: Linux
Domoticz version: 2024.4
Location: The Netherlands
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post 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!
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post 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.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post 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
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post 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' } 
	}, 
	...
}
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post 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?
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest