forSec option does not work any more on blind devices  [SOLVED]

Moderator: leecollings

Post Reply
dlube
Posts: 29
Joined: Tuesday 31 March 2020 19:29
Target OS: -
Domoticz version:
Location: France

forSec option does not work any more on blind devices

Post by dlube »

Hi All
All is inside the subject. ;)
I managed to open my garage door during 3 sec with the previous stable version of dzVents.
dz.devices("Garage door").switchOff().forSec(3)

With the latest version 3.0.1 I can use open() instead of switchOff but forSec has no effect.
dz.devices("Garage door").open().forSec(3)

Is there another way to open my garage door for 3 seconds?
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: forSec option does not work any more on blind devices

Post by waaren »

dlube wrote: Tuesday 31 March 2020 19:36 I managed to open my garage door during 3 sec with the previous stable version of dzVents.
dz.devices("Garage door").switchOff().forSec(3)
Is there another way to open my garage door for 3 seconds?
Does the old command

Code: Select all

dz.devices("Garage door").switchOff().forSec(3)
still work ?

My preference is to use this sequence of commands.

Code: Select all

garageDoor = dz.devices("Garage door")
garageDoor.cancelQueuedCommands()
garageDoor.open()
garageDoor.stop().afterSec(3)  -- or garageDoor.close().afterSec(3) -- if that's what you want.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dlube
Posts: 29
Joined: Tuesday 31 March 2020 19:29
Target OS: -
Domoticz version:
Location: France

Re: forSec option does not work any more on blind devices

Post by dlube »

Old code does not work any more.
The door opens and stop when the door is fully opened (20sec after) :D
I will try yours tomorow.
Thank you
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
dlube
Posts: 29
Joined: Tuesday 31 March 2020 19:29
Target OS: -
Domoticz version:
Location: France

Re: forSec option does not work any more on blind devices

Post by dlube »

Does not work too :(
I think that this is a regression introduced with the update of the action on blind devices.

Here is the log file

Code: Select all

2020-04-01 19:20:21.553  (ENOCEAN PI) Lighting 2 (Cde1 Bouton 3)
2020-04-01 19:20:21.636  Status: dzVents: Debug: Dumping domoticz data to /home/pi/domoticz/scripts/dzVents/domoticzData.lua
2020-04-01 19:20:21.691  Status: dzVents: Debug: Processing device-adapter for Cde1 Bouton 3: Switch device adapter
2020-04-01 19:20:21.691  Status: dzVents: Debug: dzVents version: 3.0.1
2020-04-01 19:20:21.691  Status: dzVents: Debug: Event triggers:
2020-04-01 19:20:21.691  Status: dzVents: Debug: - Device: Cde1 Bouton 3
2020-04-01 19:20:21.738  Status: dzVents: Info: Handling events for: "Cde1 Bouton 3", value: "On"
2020-04-01 19:20:21.738  Status: dzVents: Info: Télécommande Garage: ------ Start internal script: Telecommande: Device: "Cde1 Bouton 3 (ENOCEAN PI)", Index: 232
2020-04-01 19:20:21.743  Status: dzVents: Info: Télécommande Garage: ------ Finished Telecommande
2020-04-01 19:20:21.744  Status: dzVents: Debug: Commands sent to Domoticz: 
2020-04-01 19:20:21.744  Status: dzVents: Debug: - Cancel = {["idx"]=203, ["type"]="device"}
2020-04-01 19:20:21.744  Status: dzVents: Debug: - Garage = Off
2020-04-01 19:20:21.744  Status: dzVents: Debug: - Garage = Stop AFTER 3 SECONDS
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
dlube
Posts: 29
Joined: Tuesday 31 March 2020 19:29
Target OS: -
Domoticz version:
Location: France

Re: forSec option does not work any more on blind devices

Post by dlube »

I found a workaround

Code: Select all

door.open()
door.stop().at(os.date("%H:%M:%S",os.time()+3))
How to report it to the developement team?
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: forSec option does not work any more on blind devices

Post by waaren »

dlube wrote: Friday 03 April 2020 19:33 How to report it to the development team?
Good that you got it working !
I am co-developer of dzVents and the creator of the .at() method in dzVents. What it does is computing the amount of seconds from now and use that computed value in an afterSec() method. So you can imagine why I am surprised that the

Code: Select all

.at(os.date("%H:%M:%S",os.time()+3)) method -- 3 seconds from now
works and the

Code: Select all

.afterSec(3) -- 3 seconds from now
does not.

I am very much interested in the log output of both methods. If there is something unexpected I might be able to fix it.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dlube
Posts: 29
Joined: Tuesday 31 March 2020 19:29
Target OS: -
Domoticz version:
Location: France

Re: forSec option does not work any more on blind devices

Post by dlube »

Sorry, was my mistake :(
I did a lot of modifications for my tests and the type of the device was not the same.

"Blind inverted" device
The code below is working well:

Code: Select all

myDevice.open()
myDevice.stop().afterSec(3)

Code: Select all

myDevice.switchOn()
myDevice.stop().afterSec(3)
The code below is not working:

Code: Select all

myDevice.open().forSec(3)

Code: Select all

myDevice.switchOn().forSec(3)

"Blind" device
None of the code below is working:

Code: Select all

myDevice.open().forSec(3)

Code: Select all

myDevice.open()
myDevice.stop().afterSec(3)

Code: Select all

myDevice.switchOff().forSec(3)

Code: Select all

myDevice.switchOff()
myDevice.stop().afterSec(3)
Hope it help :)
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: forSec option does not work any more on blind devices

Post by waaren »

dlube wrote: Saturday 04 April 2020 11:31 I did a lot of modifications for my tests and the type of the device was not the same.
Checked this on all recent Beta's but cannot replicate this. The forSec() is ignored for open() or close() as there is no way dzVents can know what to do when the delay is over. This has been the way it worked from the moment forSec() became available in dzVents.
All other methods work as designed.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dlube
Posts: 29
Joined: Tuesday 31 March 2020 19:29
Target OS: -
Domoticz version:
Location: France

Re: forSec option does not work any more on blind devices  [SOLVED]

Post by dlube »

It was working with switchOff().forSec(3) previously.
The problem raized after the update.

For me, open().forSec(x) mean that you would like to open the door during x seconds and stop.
This is usefull with a door which do not accept percentage.
A good way to introduce it should be to create something like this myBlind.open().stopIn(3)

My solution is the following:

I create a switch and manage the state of this switch.

Code: Select all

     if mySwitch.state == 'On' then
          door.open()
     else
          door.stop()
     end
and the command to open the door for 3 s

Code: Select all

	mySwitch.switchOn().forSec(3)
Not very clean but it works.
Thank you for your support.
Raspbian Buster on Raspberry pi 3 B+ Domoticz Version: 2023.2 (build 15474)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest