Help for dimming time script [Solved]
Moderator: leecollings
- djdevil
- Posts: 101
- Joined: Friday 26 July 2019 18:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Help for dimming time script
Thx for reply.
Given the importance in daily use of my scripts, I think the fix will happen first in the beta right? so should I activate the reception of the beta version? thanks
Given the importance in daily use of my scripts, I think the fix will happen first in the beta right? so should I activate the reception of the beta version? thanks
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Help for dimming time script
Yes the fix will happen first in beta. Up to you if you want to switch to beta and help testing new features / bugfixes. I cannot recommend this if bad things will happen if domoticz does show issues. In fact I would not set the check for updates at all in such a system and wait until you see something on the forum and/or on the version wiki page and update controlled and after making a backup of your domoticz directory.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- djdevil
- Posts: 101
- Joined: Friday 26 July 2019 18:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Help for dimming time script
you have been very clear, so for now I will have to wait for the next stable version not to create mess! I will wait anxiously! thanks for everything
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Help for dimming time script
I created a Pull request to solve this issue. When OK it will be merged into a next Beta.
Next stable where the fix will be in might be taking some time to arrive.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- djdevil
- Posts: 101
- Joined: Friday 26 July 2019 18:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Help for dimming time script
thanks for the work done!waaren wrote: ↑Tuesday 28 April 2020 18:55I created a Pull request to solve this issue. When OK it will be merged into a next Beta.
Next stable where the fix will be in might be taking some time to arrive.
In the meantime, since the problem seems to affect the z-wave and zigbee devices, I created a virtual switch that follows the main switch and modified the code in this way. Now everything works as before!
Code: Select all
return
{
on =
{
devices = { 'SDB' },
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'dim based on time'
},
execute = function(dz, item)
dz.log('SDB state: ' .. item.state,dz.LOG_DEBUG)
if item.active and dz.devices('VIRTUAL DEVICE').lastUpdate.secondsAgo > 4 then
if dz.time.matchesRule('at 06:30-21:30') then
item.dimTo(100).silent()
else
item.dimTo(20).silent()
end
elseif and dz.devices('VIRTUAL DEVICE').lastUpdate.secondsAgo > 4 then
item.dimTo(0).silent()
end
end
}
-
- Posts: 361
- Joined: Monday 25 December 2017 23:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: Paris
- Contact:
Re: Help for dimming time script
I could you explain how you did this pls? "follow"I created a virtual switch that follows the main switch and modified the code in this way
- waltervl
- Posts: 5729
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Help for dimming time script
What is your problem? This should be fixed in stable 2020.2 and so also in 2021.1
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 361
- Joined: Monday 25 December 2017 23:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: Paris
- Contact:
Re: Help for dimming time script
My problem was well explained in this post viewtopic.php?f=6&t=27607&p=224799#p224799 but it disappeared from the forum

Discussed also here viewtopic.php?p=228875#p228875
My understanding of this problem is about .silent() that doesn't really work for devices like zwave and generate false trigger when a switch is switched on or off. This thing about ".silent()" is not solved for me and the ".lastUpdate.secondsAgo > 4" workaround is not good in all cases
-
- Posts: 361
- Joined: Monday 25 December 2017 23:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: Paris
- Contact:
Re: Help for dimming time script
My request was just to understand how it was done, perhaps it could be useful for other workaround, and also to understand something I could not figure out

-
- Posts: 470
- Joined: Thursday 26 October 2017 13:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Delft
- Contact:
Re: Help for dimming time script
My guess is that this behavior for z-wave devices is most likely a result of the way openzwave works: when a value gets set using openzwave, that value is stored in memory and it is sent to the device. Then when the device has accepted the value, the device responds by sending the new value back to the controller (i.e. domoticz). Both setting the value and the device's response normally trigger domoticz to call the script's execute function. When you add the silent() function, only the set value gets the silent() functionality applied, i.e. the call to execute the script is skipped. When the device's response is received however, that value change still triggers the script to be called.
-
- Posts: 361
- Joined: Monday 25 December 2017 23:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: Paris
- Contact:
Re: Help for dimming time script
That's possible indeed. I did some testing some time ago and it was not always the same pattern , perhaps due to other issues with OWZ.
I also did some simple testing with zwavejs2mqtt and I'm afraid that it could be the same... I'll do more testing in a while.
That's why I'd like to know what was the work around found in this topic...
I also did some simple testing with zwavejs2mqtt and I'm afraid that it could be the same... I'll do more testing in a while.
That's why I'd like to know what was the work around found in this topic...
Who is online
Users browsing this forum: Amazon [Bot] and 1 guest