Update device with no trigger stopped working - Dzvents

Easy to use, 100% Lua-based event scripting framework.
Post Reply
Milifax
Posts: 83
Joined: Friday 23 June 2017 9:27
Target OS: Raspberry Pi
Domoticz version: v3.8094
Location: The Netherlands
Contact:

Update device with no trigger stopped working - Dzvents

Post by Milifax » Thursday 12 October 2017 11:01

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: 820
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post by emme » Thursday 12 October 2017 12:48

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

maybe?
That's one small step for a programmer, one giant leap for me!
- - - - -
Raspberry Pi3 + AeonStick G5 + RFXCOMM433 + iRTrans Server + NodeJS
There's no stress in the mess!!

Milifax
Posts: 83
Joined: Friday 23 June 2017 9:27
Target OS: Raspberry Pi
Domoticz version: v3.8094
Location: The Netherlands
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post by Milifax » Thursday 12 October 2017 20:45

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: 1448
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post by dannybloe » Friday 13 October 2017 10:41

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: 128
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 » Wednesday 03 January 2018 7:50

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: 1448
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: Update device with no trigger stopped working - Dzvents

Post by dannybloe » Wednesday 03 January 2018 11:16

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: 128
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 » Wednesday 03 January 2018 13:02

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: 128
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 » Tuesday 09 January 2018 3:51

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 2 guests