.silent() seems not to work anymore  [Solved]

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

Moderator: leecollings

poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

.silent() seems not to work anymore

Post by poudenes »

Version: 4.10717
Build Hash: b38b49e5
Compile Date: 2019-05-09 13:04:08
dzVents Version: 2.4.19
Python Version: 3.6.4 (default, Oct 10 2018, 09:47:26) [GCC 6.3.0 20170516]

It seems that the silent() function in dzVent is not working anymore.
When I turn on a bulb with this setting:

Code: Select all

domoticz.devices(BulbDressoirAll).switchOn().silent()
domoticz.helpers.Disco(domoticz,BulbDressoir1,nil,1,1) 
domoticz.helpers.Disco(domoticz,BulbDressoir2,nil,1,2)
domoticz.helpers.Disco(domoticz,BulbDressoir3,nil,1,3)
BulbDressoirAll are the 3 bulbs BulbDressoir1,2,3 in 1 device

All 3 bulbs go on and after that the Disco part fires. Disco coded in global_data.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

poudenes wrote: Friday 10 May 2019 10:29 It seems that the silent() function in dzVent is not working anymore.
Sorry but I don't understand with the information you shared here. If you give the command switchOn() it should turn the device On. The option silent() is to be used to suppress any subsequent event triggering.
Maybe I understand better if you show the complete script(s) and relevant loglines ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: .silent() seems not to work anymore

Post by poudenes »

-- switch on but do not trigger follow up events device.switchOn().silent()
silent(): Function. No follow-up events will be triggered: mySwitch.switchOff().silent().

This is what wiki say about it.

It will turn on the device without actual action
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

poudenes wrote: Friday 10 May 2019 10:50 -- switch on but do not trigger follow up events device.switchOn().silent()
silent(): Function. No follow-up events will be triggered: mySwitch.switchOff().silent().

This is what wiki say about it.

It will turn on the device without actual action
No that is what silent() does. A 'follow up event' in the event system is not the same as the action. What you do here is ask he event system (via dzVents) to switch the device Off but prevent that action to become a trigger for a next event.

You were the OP from this thread where you asked for a method to change the state of a device in domoticz without doing the physical switch.
In that thread is was concluded that it can be done using an API but that it will trigger a subsequent event. That conclusion has not changed.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: .silent() seems not to work anymore

Post by poudenes »

So when I use this command it will turn on or off in my situation the bulb but no other events will react on the state change?
What I want is turn state of bulb on or off without turn it on for real.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

poudenes wrote: Friday 10 May 2019 17:18 So when I use this command it will turn on or off in my situation the bulb but no other events will react on the state change?
Yes. If it is device controlled by domoticz and not by a plugin.
What I want is turn state of bulb on or off without turn it on for real.
for Off use:

Code: Select all

local idx = xxxx
local Off = dz.settings['Domoticz url'] .. "/json.htm?type=command&param=udevice&nvalue=0&svalue=0&idx=" .. idx
dz.openURL(Off)
for On use

Code: Select all

local idx = xxxx
local On = dz.settings['Domoticz url'] .. "/json.htm?type=command&param=udevice&nvalue=1&svalue=1&idx=" .. idx
dz.openURL(On)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: .silent() seems not to work anymore

Post by poudenes »

Thanks. I will add this into my Notes for archiving :D

maybe a feature idea to create a nice dzVents command for it.

//Keep up the good work!
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

poudenes wrote: Saturday 11 May 2019 9:34 maybe a feature idea to create a nice dzVents command for it.
Pull request #3203 is in the process of being reviewed.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: .silent() seems not to work anymore

Post by poudenes »

:D
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: .silent() seems not to work anymore

Post by poudenes »

Did a test and quietOn quietOff work fine !! :D
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

poudenes wrote: Monday 13 May 2019 19:38 Did a test and quietOn quietOff work fine !! :D
Thanks for testing. Good to hear that it works for you !
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: .silent() seems not to work anymore

Post by poudenes »

waaren wrote: Monday 13 May 2019 19:57
poudenes wrote: Monday 13 May 2019 19:38 Did a test and quietOn quietOff work fine !! :D
Thanks for testing. Good to hear that it works for you !
Hope more people can use this command :) other wise I feel flattered :lol: :lol:
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: .silent() seems not to work anymore

Post by cherowley »

I'm using virtual devices and lua scripts - anyway to do quiet updates for this combo?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

cherowley wrote: Tuesday 21 May 2019 11:29 I'm using virtual devices and lua scripts - anyway to do quiet updates for this combo?
Yes, but remember quiet is not the same as silent :)
  • quietOn(), quietOff() ==>> status in domoticz will change but command is not send to physically attached device. Subsequent events are triggered.
  • silent() ==>> status in domoticz will change and command is send to physically attached device. Subsequent events are not triggered
For a virtual device, I cannot think of a usecase for quietOn() or quietOff() so you might want to use silent().
In standard domoticz Lua this will translate to leave out something as ["_trigger"]=true

You might want to have a look at dzVents
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: .silent() seems not to work anymore

Post by samourai47 »

Hello
I have a problem with .silent() who send order when is in action. So i try with json and it seem's to work
BUT

my garage gate who is actionned whith rfxcom. I don't have return of the position
I put a door sensor and i want, if the door is open (senseor open), modify the Garage Gate device wwithout sending action
My Garage Gate is Idx : 150
I try this

Code: Select all

return {
	on = {
		devices = {
			'Garage Sensor'
		}
	},
	
	execute = function(dz, device)
	if (device.active) then
	    local idx = 150
local Off = dz.settings['Domoticz url'] .. "/json.htm?type=command&param=udevice&nvalue=0&svalue=0&idx=" .. idx
dz.openURL(Off)
else
    local idx = 150
local On = dz.settings['Domoticz url'] .. "/json.htm?type=command&param=udevice&nvalue=1&svalue=1&idx=" .. idx
dz.openURL(On)
    end
end

}
It work's but the order are inverted. When the sensor is closed he send Open to the Gate
And when the sensor is open he send Closed to the gate

I try mamny and many change but i don't arrive at the good result

Thank's for your help
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

samourai47 wrote: Wednesday 02 December 2020 10:38 I have a problem with .silent() who send order when is in action. So i try with json and it seem's to work
It work's but the order are inverted. When the sensor is closed he send Open to the Gate
Can you try below script?

Code: Select all

return
{
    on =
    {
        devices =
        {
            'Garage Sensor',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- set to domoticz.LOG_ERROR when all is OK
        marker = 'quiet gate',
    },

    execute = function(dz, item)

        local gate = dz.devices(150)

        dz.log('State of ' .. item.name .. ' is ' .. item.state, dz.LOG_DEBUG)
        if item.active then
            gate.quietOn() -- change to gate.quietOff() if action is reverted
        else
            gate.quietOff() -- change to gate.quietOn() if action is reverted
        end 
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: .silent() seems not to work anymore

Post by samourai47 »

Thank's for your help
It work's fine.
I complete my configuration in this direction

Thank's a lot
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: .silent() seems not to work anymore

Post by samourai47 »

Hello
I have a little problem. My device is recognised as a blinds with open/stopped/closed
The dzvent script work's fine with "on" who send the "open" command
But with "off" the device is notified as "Stopped" and not as "closed"
So domoticz and other interface think it is always "open"...
Have you an idea?

Thank's for your help
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: .silent() seems not to work anymore

Post by waaren »

samourai47 wrote: Friday 04 December 2020 21:50 I have a little problem. My device is recognised as a blinds with open/stopped/closed
Is this issue with the same device as was used in the earlier question and with the quietOn() and quietOff() methods or is this about something else?
What is the deviceType and deviceSubtype of the device as shown on the device tab?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
samourai47
Posts: 50
Joined: Wednesday 06 March 2019 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: .silent() seems not to work anymore

Post by samourai47 »

Thank's for your help
It's the same configuration as used in the earlier question.

The device that i wan't have position is a rfxcom somfy garage gate who is recognised as a blind with 3 positions Open/ Closed / Stopped. I can actionned with domoticz button or with a telecommande or with google voice. In this case domoticz dont' see the change.

My idea is to add a door sensor on the gate.
-> If the gate is open door sensor it open and send "on" on the garage gate who chage to open.
-> if the sensor is closed it send Off on the garage gate who change to closed. . In this case, it change to stopped and domoticz do not recognize the position.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest