This workflow make AltUI crash

I have had a workflow for some time now, but after I added checks for how many watts a wall plug uses, this workflow make AltUI plugin crash.
First I found a problem with incorrect number of () but I think I fixed them, and the problem remains.
Whenever I disable the workflow things work again, but I cannot find the problem.

If you got time for it, please help to see if I have a syntax or logics problem! (sometimes you need additional eyes to spot typos)

Here is the overview:

House modes - (0-1)
11 States: Start, Selector, Home, Away, Night, Vacation, Home (timout to Night mode), Set Night mode, Set Home mode, Set Away Mode, Timeout to Away mode
21 Transitions: 1h timer, House mode is Home, House mode is Vacation, House mode is not Vacation, House mode is Away, House mode is not Away, Clone of House mode is Away, Clone of 1h timer, Bedroom door open and time is 05-12, House mode is Night, Go to select, Clone of Motion detected, No motion and time between 09:00-21:00, House mode is not Night, House mode is not Home, Clone of House mode is Home, Clone of Clone of House mode is not Home, Clone of House mode is Night, No motion and time between 23:00-04:00 , Motion detected, Clone of House mode is not Home
Details
Start - 54ef024a-accd-4b3e-8d56-f89e0d564aa5
Transitions
'Go to select' - b18224d0-0b8b-4be0-b5da-d3d640eb1a68
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new > '0')
Moves To
State: Selector
Selector - bb439148-bfad-42c3-9ca2-eae5962ece81
Transitions
'House mode is Home' - 84500576-881a-4883-9e70-c54e4bdd89c9
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '1')
Moves To
State: Home
'House mode is Vacation' - 2feef037-686e-4eb7-abdd-01f0d59640ab
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '4')
Moves To
State: Vacation
'House mode is Away' - c2a637f6-8f1c-4e4f-9988-c206a88bc592
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '2')
Moves To
State: Away
'House mode is Night' - 250d02f0-315f-4d7b-87e4-3dd606bcdd9e
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '3')
Moves To
State: Night
Home - 93d49092-4e51-4bd1-99b3-1d690d7b2a00
OnEnter
on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}]
on WP Dator #126 (0-126) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}]
on RGBW Trapp #128 (0-128) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"0,0,25"}]
on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"0,0,255"}]
run Mysbelysning CT Start (0-36)
Transitions
'No motion and time between 09:00-21:00' - bce3619d-c836-4b1e-974c-fb14823c7de8
When
device:'K?ket Motion #16' (0-16) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'NH Motion #13' (0-13) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'VDR Motion #10' (0-10) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'?H Motion #19' (0-19) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'Kanind?rr #7' (0-7) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'F?rr?dsd?rr #8' (0-8) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'Altand?rr #6' (0-6) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'Ytterd?rr #5' (0-5) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'Sovrumsd?rr #9' (0-9) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00"))))
device:'WP TV #26' (0-26) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new <= '2') and (ALTUI.time_is_between("09:00","21:00"))))
device:'WP Dator #126' (0-126) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new <= '2') and (ALTUI.time_is_between("09:00","21:00"))))
Moves To
State: Timeout to Away mode
'House mode is not Home' - a59fe67c-fc1f-4857-917e-0e4395f67dd2
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '1')
Moves To
State: Selector
'No motion and time between 23:00-04:00 ' - 2b8d3fc8-3564-4990-85fc-aa684d77c647
When
device:'K?ket Motion #16' (0-16) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'NH Motion #13' (0-13) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'VDR Motion #10' (0-10) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'?H Motion #19' (0-19) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'Kanind?rr #7' (0-7) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'F?rr?dsd?rr #8' (0-8) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'Altand?rr #6' (0-6) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'Ytterd?rr #5' (0-5) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'WP TV #26' (0-26) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new >= '2') and (ALTUI.time_is_between("23:00","04:00"))))
device:'WP Dator #126' (0-126) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new >= '2') and (ALTUI.time_is_between("23:00","04:00"))))
Moves To
State: Home (timout to Night mode)
Away - 1782b69b-3568-4a09-a747-47d7867f8ee6
OnEnter
on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on SW Mysbelysning #90 (0-90) urn:upnp-org:serviceId:VSwitch1-SetTarget [{"name":"newTargetValue","value":"0"}]
on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on WP Dator #126 (0-126) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"255,0,0"}]
on RGBW Trapp #128 (0-128) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"25,0,0"}]
Transitions
'House mode is not Away' - 22f1ca59-a493-449e-9ac1-438270a9d89a
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '2')
Moves To
State: Selector
Night - 327d3881-f2ae-4a9f-aa04-7c0ceeadf8d8
OnEnter
on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}]
on WP Arbetsrum #31 (0-31) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}]
on RGBW Trapp #128 (0-128) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"25,0,0"}]
on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"255,0,0"}]
Transitions
'Bedroom door open and time is 05-12' - f649dcf3-57fd-4d97-accf-0242fe6dc13a
When
device:'Sovrumsd?rr #9' (0-9) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '1') and (ALTUI.time_is_between("05:00","12:00"))))
Moves To
State: Set Home mode
'House mode is not Night' - 911bab70-8359-47af-9495-1f13e93f4e01
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '3')
Moves To
State: Selector
Vacation - d570a63b-749e-44fc-9c7a-1167ae86754d
OnEnter
on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on SW Mysbelysning #90 (0-90) urn:upnp-org:serviceId:VSwitch1-SetTarget [{"name":"newTargetValue","value":"0"}]
on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on WP Dator #126 (0-126) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on RGBW Trapp #128 (0-128) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}]
on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"255,0,0"}]
Transitions
'House mode is not Vacation' - 476c0a21-a3f3-4179-aa4c-3f4e13174576
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '4')
Moves To
State: Selector
Home (timout to Night mode) - d6c6296e-61de-4c0b-b1fc-684780244350
Transitions
'1h timer' - 7763c306-18ce-4744-ac37-bd0e6797a308
When
Timer: '1h' expiration 3600s
Moves To
State: Set Night mode
'Motion detected' - cbd500cd-1f95-4154-9708-e99e8ab1e90a
When
device:'SW Motion detec #95' (0-95) when urn:upnp-org:serviceId:VSwitch1-Status (new=='1')
Moves To
State: Home
'Clone of House mode is not Home' - ea857dae-ba27-4305-ac58-39acd6d6826d
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '1')
Moves To
State: Selector
Set Night mode - 39fea2d6-2d29-442b-94b2-c6e4626d1ac0
OnEnter
on House Modes Plugin (0-40) urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{"name":"newHModeValue","value":"3"}]
Transitions
'Clone of House mode is Night' - 3d89b2b4-7692-4558-bec6-a976cffe35c9
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '3')
Moves To
State: Night
Set Home mode - 634e588b-0e2d-45c1-a318-12f293c5a6ec
OnEnter
on House Modes Plugin (0-40) urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{"name":"newHModeValue","value":"1"}]
Transitions
'Clone of House mode is Home' - bc6c4597-a007-4b1d-8346-30fb97597c5d
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '1')
Moves To
State: Home
Set Away Mode - 3b99b33b-1458-418f-83e3-b6bbfdb0ef10
OnEnter
on House Modes Plugin (0-40) urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{"name":"newHModeValue","value":"2"}]
Transitions
'Clone of House mode is Away' - 55975562-60b1-457a-acfb-03dc64643b6e
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '2')
Moves To
State: Away
Timeout to Away mode - 6ee5f0b1-f69a-44a4-a811-ecfb5b5fc2db
Transitions
'Clone of 1h timer' - cc5fcb3d-efa5-4acc-b0e1-948bd0f05871
When
Timer: '1h' expiration 3600s
Moves To
State: Set Away Mode
'Clone of Motion detected' - 6002c69d-2c53-4ace-b670-0d3a3916fff3
When
device:'SW Motion detec #95' (0-95) when urn:upnp-org:serviceId:VSwitch1-Status (new=='1')
Moves To
State: Home
'Clone of Clone of House mode is not Home' - 4c2df091-4e31-4f81-a083-04dafed49d4a
When
device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '1')
Moves To
State: Selector

[quote=“vitmar, post:1, topic:193940”]I have had a workflow for some time now, but after I added checks for how many watts a wall plug uses, this workflow make AltUI plugin crash.
First I found a problem with incorrect number of () but I think I fixed them, and the problem remains.
Whenever I disable the workflow things work again, but I cannot find the problem.

If you got time for it, please help to see if I have a syntax or logics problem! (sometimes you need additional eyes to spot typos)

Here is the overview:

House modes - (0-1) 11 States: Start, Selector, Home, Away, Night, Vacation, Home (timout to Night mode), Set Night mode, Set Home mode, Set Away Mode, Timeout to Away mode 21 Transitions: 1h timer, House mode is Home, House mode is Vacation, House mode is not Vacation, House mode is Away, House mode is not Away, Clone of House mode is Away, Clone of 1h timer, Bedroom door open and time is 05-12, House mode is Night, Go to select, Clone of Motion detected, No motion and time between 09:00-21:00, House mode is not Night, House mode is not Home, Clone of House mode is Home, Clone of Clone of House mode is not Home, Clone of House mode is Night, No motion and time between 23:00-04:00 , Motion detected, Clone of House mode is not Home Details Start - 54ef024a-accd-4b3e-8d56-f89e0d564aa5 Transitions 'Go to select' - b18224d0-0b8b-4be0-b5da-d3d640eb1a68 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new > '0') Moves To State: Selector Selector - bb439148-bfad-42c3-9ca2-eae5962ece81 Transitions 'House mode is Home' - 84500576-881a-4883-9e70-c54e4bdd89c9 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '1') Moves To State: Home 'House mode is Vacation' - 2feef037-686e-4eb7-abdd-01f0d59640ab When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '4') Moves To State: Vacation 'House mode is Away' - c2a637f6-8f1c-4e4f-9988-c206a88bc592 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '2') Moves To State: Away 'House mode is Night' - 250d02f0-315f-4d7b-87e4-3dd606bcdd9e When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '3') Moves To State: Night Home - 93d49092-4e51-4bd1-99b3-1d690d7b2a00 OnEnter on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}] on WP Dator #126 (0-126) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}] on RGBW Trapp #128 (0-128) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"0,0,25"}] on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"0,0,255"}] run Mysbelysning CT Start (0-36) Transitions 'No motion and time between 09:00-21:00' - bce3619d-c836-4b1e-974c-fb14823c7de8 When device:'K?ket Motion #16' (0-16) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'NH Motion #13' (0-13) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'VDR Motion #10' (0-10) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'?H Motion #19' (0-19) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'Kanind?rr #7' (0-7) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'F?rr?dsd?rr #8' (0-8) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'Altand?rr #6' (0-6) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'Ytterd?rr #5' (0-5) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'Sovrumsd?rr #9' (0-9) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("09:00","21:00")))) device:'WP TV #26' (0-26) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new <= '2') and (ALTUI.time_is_between("09:00","21:00")))) device:'WP Dator #126' (0-126) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new <= '2') and (ALTUI.time_is_between("09:00","21:00")))) Moves To State: Timeout to Away mode 'House mode is not Home' - a59fe67c-fc1f-4857-917e-0e4395f67dd2 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '1') Moves To State: Selector 'No motion and time between 23:00-04:00 ' - 2b8d3fc8-3564-4990-85fc-aa684d77c647 When device:'K?ket Motion #16' (0-16) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'NH Motion #13' (0-13) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'VDR Motion #10' (0-10) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'?H Motion #19' (0-19) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'Kanind?rr #7' (0-7) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'F?rr?dsd?rr #8' (0-8) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'Altand?rr #6' (0-6) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'Ytterd?rr #5' (0-5) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'WP TV #26' (0-26) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new >= '2') and (ALTUI.time_is_between("23:00","04:00")))) device:'WP Dator #126' (0-126) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((new >= '2') and (ALTUI.time_is_between("23:00","04:00")))) Moves To State: Home (timout to Night mode) Away - 1782b69b-3568-4a09-a747-47d7867f8ee6 OnEnter on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on SW Mysbelysning #90 (0-90) urn:upnp-org:serviceId:VSwitch1-SetTarget [{"name":"newTargetValue","value":"0"}] on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on WP Dator #126 (0-126) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"255,0,0"}] on RGBW Trapp #128 (0-128) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"25,0,0"}] Transitions 'House mode is not Away' - 22f1ca59-a493-449e-9ac1-438270a9d89a When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '2') Moves To State: Selector Night - 327d3881-f2ae-4a9f-aa04-7c0ceeadf8d8 OnEnter on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}] on WP Arbetsrum #31 (0-31) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"1"}] on RGBW Trapp #128 (0-128) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"25,0,0"}] on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"255,0,0"}] Transitions 'Bedroom door open and time is 05-12' - f649dcf3-57fd-4d97-accf-0242fe6dc13a When device:'Sovrumsd?rr #9' (0-9) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '1') and (ALTUI.time_is_between("05:00","12:00")))) Moves To State: Set Home mode 'House mode is not Night' - 911bab70-8359-47af-9495-1f13e93f4e01 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '3') Moves To State: Selector Vacation - d570a63b-749e-44fc-9c7a-1167ae86754d OnEnter on WP K?k F?nster #29 (0-29) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on SW Mysbelysning #90 (0-90) urn:upnp-org:serviceId:VSwitch1-SetTarget [{"name":"newTargetValue","value":"0"}] on WP TV #26 (0-26) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on WP Dator #126 (0-126) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on RGBW Trapp #128 (0-128) urn:upnp-org:serviceId:SwitchPower1-SetTarget [{"name":"newTargetValue","value":"0"}] on RGBW K?ket #97 (0-97) urn:micasaverde-com:serviceId:Color1-SetColorRGB [{"name":"newColorRGBTarget","value":"255,0,0"}] Transitions 'House mode is not Vacation' - 476c0a21-a3f3-4179-aa4c-3f4e13174576 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '4') Moves To State: Selector Home (timout to Night mode) - d6c6296e-61de-4c0b-b1fc-684780244350 Transitions '1h timer' - 7763c306-18ce-4744-ac37-bd0e6797a308 When Timer: '1h' expiration 3600s Moves To State: Set Night mode 'Motion detected' - cbd500cd-1f95-4154-9708-e99e8ab1e90a When device:'SW Motion detec #95' (0-95) when urn:upnp-org:serviceId:VSwitch1-Status (new=='1') Moves To State: Home 'Clone of House mode is not Home' - ea857dae-ba27-4305-ac58-39acd6d6826d When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '1') Moves To State: Selector Set Night mode - 39fea2d6-2d29-442b-94b2-c6e4626d1ac0 OnEnter on House Modes Plugin (0-40) urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{"name":"newHModeValue","value":"3"}] Transitions 'Clone of House mode is Night' - 3d89b2b4-7692-4558-bec6-a976cffe35c9 When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '3') Moves To State: Night Set Home mode - 634e588b-0e2d-45c1-a318-12f293c5a6ec OnEnter on House Modes Plugin (0-40) urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{"name":"newHModeValue","value":"1"}] Transitions 'Clone of House mode is Home' - bc6c4597-a007-4b1d-8346-30fb97597c5d When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '1') Moves To State: Home Set Away Mode - 3b99b33b-1458-418f-83e3-b6bbfdb0ef10 OnEnter on House Modes Plugin (0-40) urn:micasaverde-com:serviceId:HouseModes1-SetHMode [{"name":"newHModeValue","value":"2"}] Transitions 'Clone of House mode is Away' - 55975562-60b1-457a-acfb-03dc64643b6e When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new == '2') Moves To State: Away Timeout to Away mode - 6ee5f0b1-f69a-44a4-a811-ecfb5b5fc2db Transitions 'Clone of 1h timer' - cc5fcb3d-efa5-4acc-b0e1-948bd0f05871 When Timer: '1h' expiration 3600s Moves To State: Set Away Mode 'Clone of Motion detected' - 6002c69d-2c53-4ace-b670-0d3a3916fff3 When device:'SW Motion detec #95' (0-95) when urn:upnp-org:serviceId:VSwitch1-Status (new=='1') Moves To State: Home 'Clone of Clone of House mode is not Home' - 4c2df091-4e31-4f81-a083-04dafed49d4a When device:'House Modes Plugin' (0-40) when urn:micasaverde-com:serviceId:HouseModes1-HMode (new ~= '1') Moves To State: Selector [/quote]
I ll look but I ll be hard as it is big.
Can you enable debug mode or altui and let i t run then send the logs to me ?

Hi Vitmar,

I think that I got the same issue than yours a few weeks ago and would try to change the (new <= “2”) by (tonumber(new) <= 2)

[quote=“papapout, post:3, topic:193940”]Hi Vitmar,

I think that I got the same issue than yours a few weeks ago and would try to change the (new <= “2”) by (tonumber(new) <= 2)[/quote]

correct, same for (new > ‘0’) which is not valid either. new, like luup.variable_get returns a string typed value and must be converted to number before applying comparison or arythmetic with numbers

Oh, thank you!

Ill try that right away! :slight_smile:

EDIT:

It worked fine! And now I remember that I converted it from a “blocky” command like this:

((luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "Watts", 126)) > '2')

into new >"2"

Ill have to remember to convert values in the future.

Btw, do I need the extra () or would it work with just:

(tonumber(new) >= 2) and (ALTUI.time_is_between("09:00","21:00"))

instead of:

((tonumber(new) >= 2) and (ALTUI.time_is_between("09:00","21:00")))

I think that both should work.
I have a preference for keeping expressions as simple as possible but after 2 years practising LUA with my Vera I still have surprises… ;D

When I first found AltUI I began the work to migrate EVERYTHING to workflows but run into strange behavior and problems.
After X workflows my Vera could not save changes anymore. amg0 looked at it and we think its limited to the way Vera handles variables.
I moved back everything that did not need logical arguments to scenes but all the “nil” variables are still there and cannot be removed (Vera limitation).

Because of this I just made a decision to move all the actions from the large workflow states to scenes instead.
From the workflow I can call the scene and save a lot of characters from being stored as AltUI-workflow variables.

With some luck and if I’m right, I should be able to have more workflows when they store less data. :slight_smile:

Empty variable can sometime be deleted by setting an empty value in it and reload Luup and it only works if the variable is the last one created in the device …

You are right using scenes as the workflow state action will reduce space used by them. Also the new presentation with Fsa states takes less space. Vera tells me there are no limits except memory as the load every thing in memory …

Fix device state action in debug page now removes empty variables of a device

Great, Ill try it out as soon as I figure out how to make AltUI upgrade when I accidentally clicked “ignore for 24h” and now I it wont even find the new version when I choose “check for updates”.

After the latest update I have had strange things happening to AltUI in the evening, I suspect there is something with this ALTUI.time_is_between feature, because that is the only thing that triggers at the time of the strangeness (Vera become slow and loose connection with some devices etc).

Is this the correct way to use the funcion?

'No motion and time between 23:00-04:00 ' - 2b8d3fc8-3564-4990-85fc-aa684d77c647
When
device:'K?ket Motion #16' (0-16) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'NH Motion #13' (0-13) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'VDR Motion #10' (0-10) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'?H Motion #19' (0-19) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'Kanind?rr #7' (0-7) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'F?rr?dsd?rr #8' (0-8) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'Altand?rr #6' (0-6) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'Ytterd?rr #5' (0-5) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00"))))
device:'WP TV #26' (0-26) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((tonumber(new) <= 2) and (ALTUI.time_is_between("23:00","04:00"))))
Moves To
State: Home (timout to Night mode)

[quote=“vitmar, post:11, topic:193940”]After the latest update I have had strange things happening to AltUI in the evening, I suspect there is something with this ALTUI.time_is_between feature, because that is the only thing that triggers at the time of the strangeness (Vera become slow and loose connection with some devices etc).

Is this the correct way to use the funcion?

'No motion and time between 23:00-04:00 ' - 2b8d3fc8-3564-4990-85fc-aa684d77c647 When device:'K?ket Motion #16' (0-16) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'NH Motion #13' (0-13) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'VDR Motion #10' (0-10) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'?H Motion #19' (0-19) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'Kanind?rr #7' (0-7) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'F?rr?dsd?rr #8' (0-8) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'Altand?rr #6' (0-6) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'Ytterd?rr #5' (0-5) when urn:micasaverde-com:serviceId:SecuritySensor1-Tripped (((new == '0') and (ALTUI.time_is_between("23:00","04:00")))) device:'WP TV #26' (0-26) when urn:micasaverde-com:serviceId:EnergyMetering1-Watts (((tonumber(new) <= 2) and (ALTUI.time_is_between("23:00","04:00")))) Moves To State: Home (timout to Night mode) [/quote]

hard to say but that would be a definitely expensive treatment (each condition is evaluated in its own lua space and here the repeatition of ALTUI.time_is_between(“23:00”,“04:00”) is the killer

a possible idea could be to use a Bag[“nighttime”]=ALTUI.time_is_between(“23:00”,“04:00”) in one state action and use Bag[“nighttime”] in the conditions instead of the call to ALTUI.time_is_between()

Hmm, ok. I’m a bit confused over the bag variable handling but I could just create a virtual switch that is switched on or off with a scene based on time and then use that switch as a condition in the transitions.

Thanks for the help!

[quote=“vitmar, post:13, topic:193940”]Hmm, ok. I’m a bit confused over the bag variable handling but I could just create a virtual switch that is switched on or off with a scene based on time and then use that switch as a condition in the transitions.

Thanks for the help![/quote]

if that helps, inside Bag[] you create any variable you want, like for instance Bag[“varname”]=1 in any of your states onEnter or onExit.
for instance it can be refreshed every 1min with just a timer state that goes there and comes back but in one of its onEnter lua do a Bag[“varname”]= xxx whatever

then the value Bag[“varname”] is available in any for your transition conditions to do whatever you want.
see some examples in the workflow thread.