Some devices are skipped in script

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

Moderator: leecollings

Post Reply
gryzli133
Posts: 14
Joined: Wednesday 23 August 2017 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Some devices are skipped in script

Post by gryzli133 »

Hi, I have small problem with some devices. These are working well with Timers but not with script. For my Blinds I have some script and only 5 of 7 same blinds are working correctly, the rest are not moving at all...

Code: Select all

return {
	on = {
		timer = {'0 minutes before sunrise'}
	},
	execute = function(domoticz, triggeredItem)
	    local level = 100
	    local levelWschod = 100
	    
	    if (domoticz.devices(422).active) then -- ochrona przed słońcem
	        levelWschod = 0
	        level = 30
            end
	   
	if (domoticz.devices(723).level < level) then    --Roleta WC biuro
	   domoticz.devices(723).dimTo(level) end
	if (domoticz.devices(717).level < level) then    --Roleta socjalny
	   domoticz.devices(717).setLevel(level) end
	if (domoticz.devices(718).level < level) then    --Roleta lewa od górnej biuro
	   domoticz.devices(718).dimTo(level) end
	if (domoticz.devices(719).level < level) then    --Roleta prawa od górnej biuro
	   domoticz.devices(719).dimTo(level) end
	if (domoticz.devices(720).level < levelWschod) then    --Roleta lewa od bocznej biuro
	   domoticz.devices(720).dimTo(levelWschod) end
	if (domoticz.devices(721).level < levelWschod) then    --Roleta prawa od bocznej biuro
	   domoticz.devices(721).dimTo(levelWschod) end
	if (domoticz.devices(722).level < level) then    --Roleta okno balkonowe biuro
	   domoticz.devices(722).dimTo(level) end
		
	end
}
}
Only the two first one are not working. Similar problem I have on other script, where 15 Blinds are working fine and only 2 not - last two.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Some devices are skipped in script

Post by waaren »

gryzli133 wrote: Thursday 14 January 2021 16:10 Hi, I have small problem with some devices. These are working well with Timers but not with script. For my Blinds I have some script and only 5 of 7 same blinds are working correctly, the rest are not moving at all...

Only the two first one are not working. Similar problem I have on other script, where 15 Blinds are working fine and only 2 not - last two.
Are all blinds configured the same? All inverted or all not inverted?

Best to add some debug loglines to see the state and level of all devices at script start,
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
gryzli133
Posts: 14
Joined: Wednesday 23 August 2017 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Some devices are skipped in script

Post by gryzli133 »

I found this in the LOG:

2021-01-19 07:39:01.709 Error: MySensors: Repeating previous command (2/2)
2021-01-19 07:39:02.911 Error: MySensors: Command not received by Node !! (node_id: 41, child_id: 1)
2021-01-19 07:39:04.113 Error: MySensors: Repeating previous command (2/2)
2021-01-19 07:39:05.314 Error: MySensors: Command not received by Node !! (node_id: 41, child_id: 2)

But this is strange, all shades are one the same Arduino Mega, same config on MySensors side and in Domoticz. I have 3 Arduino Mega boards for my blinds - 1st floor, 2nd floor and office. 2nd floor all are working fine. 1st floor the last two sensors are not working. 2nd floor the first two sensors are not working. I have no idea what can it be. Controling from timers or manually works Always.

Sketch is available here: https://github.com/gryzli133/RollerShutterSplit
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Some devices are skipped in script

Post by waaren »

gryzli133 wrote: Tuesday 19 January 2021 12:56 I found this in the LOG:
2021-01-19 07:39:02.911 Error: MySensors: Command not received by Node !! (node_id: 41, child_id: 1)

But this is strange, all shades are one the same Arduino Mega, same config on MySensors side and in Domoticz.
I notice that one of the commands is setLevel() and the other ones are dimTo() is that a mistake or on purpose?

Could it be a flooding issue? Now all dimTo() are send within milliSeconds. Can you change that to dimTo(level).afterSec(1) to the 2nd shade and dimTo(level).afterSec(2) to the 3rd, etc..
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
gryzli133
Posts: 14
Joined: Wednesday 23 August 2017 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Some devices are skipped in script

Post by gryzli133 »

I was checking if this makes a difference - but same behavior for setLevel() and dimTo().

Do I need extra Time-trigger to get afterSec() working? I was testing this feature with other function and afterMin(5) was not working.

What is wondering, I have two similar scripts, once the first two Blinds are not working, on other script the last two.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Some devices are skipped in script

Post by waaren »

gryzli133 wrote: Monday 25 January 2021 17:35 I was checking if this makes a difference - but same behavior for setLevel() and dimTo().
Do I need extra Time-trigger to get afterSec() working? I was testing this feature with other function and afterMin(5) was not working.
You don't need an extra Time trigger for this. Can you be specific about 'other function' ? You can see in this table on the wiki page which function types can use the afterMin() method.
What is wondering, I have two similar scripts, once the first two Blinds are not working, on other script the last two.
I don't understand your remark / question
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest