Can not turn on any lamps, only off works

I have a weird problem. After upgrade to the latest firmware I could no longer control any of my Philips Hue lamps. So I uninstalled rebooted and reinstalled AltHue.
I paired it to the bridge and my lamps appeared in the device list.
The problem is that I cannot turn them on. The icon states that they already are ON. If I turn them on with the Hue app, I can turn them off by AltHue, BUT the icon does not change.

It’s the same from the app (Android) as from the Vera webpage.
Running the latest version of Vera firmware: 1.7.4955 (7.31)
AltHue Version: 1.49

Please advise what to do.

verify your settings, what are the values of all the variable of the ALTHUE device ?
I am on latest firmware with quite a lot of Hue lamps, I have no problem to turn them on or off

Thank you for your reply. My settings attached below

I edited your post because it included credentials
Resend it to me in private mail please

What you can do is:

First of all verify that it works with the philips hue mobile app.

Then:
Send me the exact philips device name that does not work
Send me the backend you use ( Vera ? Version ? And Ui ? )
Enable debug mode on althue
Reload Luup
Make a note of the time
Try the turn on turn off sequence
Allow a few seconds between on and off
Collect the log file on Vera
Send me the log via private email

I answer your questions in order:
The behavior is NOT any different from the app, I get exactly the same error there.
All of my Philips Hue devices are acting like this. I have around 25 of them, lightstrips, color bulbs, color spots etc.
Vera Plus 1.7.4970 (7.31) UI 7
How do I enable debug mode and how do I reload luup?

I think that I have narrowed down the root cause somewhat. It appears as its the “feedback” to the webpage or the App that doesn’t work. The power ON “button” never changes state to OFF after the command is sent. Hence I cannot wake the lamp again as the button still will turn it OFF.
If I use the lumicity slider to wake the lamp it turns on and I can put it out by pressing OFF.

I just installed the very latest Firmware but that did not help this problem.
Thank you for your time and help!

debug mode is turned on with this control.

reload luup can be done here:

getting back the log can be done as explained here:
http://wiki.micasaverde.com/index.php/Logs

Thanks. Done that now.
Another question:
When I try D_ALTHUE_UI7.json in the device simulator I get these warnings, is that expected?

The following warnings were encountered while checking the JSON:
    * Missing property "ControlGroup" for control. If property is not present the control will not be drawn in Devices page.
    {"ControlType":"label","top":"0","left":"0","text_align":"left","Label":{"lang_tag":"debug_label","text":"Debug Mode:"},"Display":{"Top":60,"Left":10,"Width":50,"Height":20}}
    * Missing property "ControlCode" for control. If property is not present the control will not be supported in scenes.
    {"ControlType":"label","top":"0","left":"0","text_align":"left","Label":{"lang_tag":"debug_label","text":"Debug Mode:"},"Display":{"Top":60,"Left":10,"Width":50,"Height":20}}
    * Missing property "ControlGroup" for control. If property is not present the control will not be drawn in Devices page.
    {"ControlType":"multi_state_button","top":"0","left":"0","Display":{"Top":50,"Left":140},"states":[{"Label":{"lang_tag":"debug_on","text":"Debug"},"ControlGroup":"1","Display":{"Service":"urn:upnp-org:serviceId:althue1","Variable":"Debug","Value":"1"},"Command":{"Service":"urn:upnp-org:serviceId:althue1","Action":"SetDebug","Parameters":[{"Name":"newDebugMode","Value":"1"}]},"ControlCode":"debug_on"},{"Label":{"lang_tag":"debug_off","text":"UnDebug"},"ControlGroup":"1","Display":{"Service":"urn:upnp-org:serviceId:althue1","Variable":"Debug","Value":"0"},"Command":{"Service":"urn:upnp-org:serviceId:althue1","Action":"SetDebug","Parameters":[{"Name":"newDebugMode","Value":"0"}]},"ControlCode":"debug_off"}]}
    * Missing property "ControlCode" for control. If property is not present the control will not be supported in scenes.
    {"ControlType":"multi_state_button","top":"0","left":"0","Display":{"Top":50,"Left":140},"states":[{"Label":{"lang_tag":"debug_on","text":"Debug"},"ControlGroup":"1","Display":{"Service":"urn:upnp-org:serviceId:althue1","Variable":"Debug","Value":"1"},"Command":{"Service":"urn:upnp-org:serviceId:althue1","Action":"SetDebug","Parameters":[{"Name":"newDebugMode","Value":"1"}]},"ControlCode":"debug_on"},{"Label":{"lang_tag":"debug_off","text":"UnDebug"},"ControlGroup":"1","Display":{"Service":"urn:upnp-org:serviceId:althue1","Variable":"Debug","Value":"0"},"Command":{"Service":"urn:upnp-org:serviceId:althue1","Action":"SetDebug","Parameters":[{"Name":"newDebugMode","Value":"0"}]},"ControlCode":"debug_off"}]}
    * Missing property "ControlGroup" for control. If property is not present the control will not be drawn in Devices page.
    {"ControlType":"label","top":"1","left":"0","text_align":"left","Label":{"lang_tag":"ALTHUE_version","text":"Version"},"Display":{"Top":110,"Left":10,"Width":50,"Height":20}}
    * Missing property "ControlCode" for control. If property is not present the control will not be supported in scenes.
    {"ControlType":"label","top":"1","left":"0","text_align":"left","Label":{"lang_tag":"ALTHUE_version","text":"Version"},"Display":{"Top":110,"Left":10,"Width":50,"Height":20}}
    * Incorrect value for property "ControlGroup". This should be set to an existing control group, otherwise the control will not be drawn in Devices page.
    {"ControlGroup":"2","ControlType":"variable","top":"-1","left":"0","x":"1","text_align":"left","Display":{"Service":"urn:upnp-org:serviceId:althue1","Variable":"Version","Top":130,"Left":10,"Width":50,"Height":20}}
    * Missing property "ControlCode" for control. If property is not present the control will not be supported in scenes.
    {"ControlGroup":"2","ControlType":"variable","top":"-1","left":"0","x":"1","text_align":"left","Display":{"Service":"urn:upnp-org:serviceId:althue1","Variable":"Version","Top":130,"Left":10,"Width":50,"Height":20}}

Hi,

Attached is the LuaUPnP.log events related to a press on the OFF-button for one of my lamps.
The lamp turns off good, but the icon never changes state from ON:
image

If I slide the lever I can turn the lamp back on. If the lamp is on and I slide the lever it works, I get the “Sending Command” the light adjusts and the lever remains at the percentage (I assume that it actually fetches the value and refreshes the graphic?)
However. If I slide the lever all the way down to 0%, I get “Sending Command”, the lamp turns off, BUT the lever refreshes back to where it was before I adjusted it.

08      03/03/20 3:27:30.110    JobHandler_LuaUPnP::HandleActionRequest device: 190 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x747bf520>
08      03/03/20 3:27:30.110    JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=190 <0x747bf520>
08      03/03/20 3:27:30.110    JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x747bf520>
08      03/03/20 3:27:30.110    JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x747bf520>
08      03/03/20 3:27:30.111    JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=0 <0x747bf520>
08      03/03/20 3:27:30.111    JobHandler_LuaUPnP::HandleActionRequest argument rand=0.31013847059515864 <0x747bf520>
50      03/03/20 3:27:30.111    luup_log:173: ALTHUE: debug: UserSetPowerTarget(190,0) <0x747bf520>
50      03/03/20 3:27:30.111    luup_log:173: ALTHUE: debug: UserSetLoadLevelTarget(190,0) <0x747bf520>
50      03/03/20 3:27:30.112    luup_log:173: ALTHUE: debug: HueLampSetState(190,{"on": false}) <0x747bf520>
50      03/03/20 3:27:30.112    luup_log:173: ALTHUE: debug: ALTHueHttpCall(173,PUT,lights/4/state,{"on": false}) <0x747bf520>
50      03/03/20 3:27:30.112    luup_log:173: ALTHUE: debug: Calling Hue with PUT http://192.168.x.x/api/qh8Mf699dyUAsd-6hCkm8RGo0slJzgrl0CdJSR3L/lights/4/state , body:{"on": false} <0x747bf520>
50      03/03/20 3:27:30.148    luup_log:173: ALTHUE: debug: request:1 <0x747bf520>
50      03/03/20 3:27:30.148    luup_log:173: ALTHUE: debug: code:200 <0x747bf520>
50      03/03/20 3:27:30.148    luup_log:173: ALTHUE: debug: data:[{"success":{"/lights/4/state/on":false}}] <0x747bf520>

Expected & not related

I need the complete log and focused on a very precise and single test, ideally you bite the time of the actions so I can follow between the log and the actions , otherwise it is not possible to investigate what’s happening.

It is normal that there is a latency before the ui catches up the real state of the device (on or off ) but it should after a while

I have not gone to the latest firmware for my Vera Plus yet due to the known issue of “Issue reported with not being able to control Hue devices with the Philips Hue 2 plugin.” However I only see this one issue with the inability to control the Philips lights. Is this known issue from the other Hue 2 plugin? And not this one?

EDIT: Looks like it is the other plugin. I updated my firmware and everything looks great. I can still turn on/off my lights and they report properly back into Vera. The super exciting new, not related to the AltHue plugin. This is the FIRST firmware upgrade where I did not have to power cycle the box after waiting 15 minutes. Everything came back on its own.

1 Like

Hi,

Sorry for the long time to reply, I’ve had too much at work lately.
Now I finally got some time to take up this again.

I think that I have narrowed down the problem somewhat.
I can turn off the lamp with
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },394)
But when I run
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },394)

The command is replaced with “dim 100”, which apparently does not turn the lamp on.

02      04/13/20 12:56:39.410   JobHandler_LuaUPnP::ConfirmGlobalActionRules replaced binary on with dim 100 <0x74381520>
50      04/13/20 12:56:39.411   luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,100) <0x74381520>

This is the LuaUPnP.log covering these luup code executions with debug mode enabled:

Turning off
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },394):
08 04/13/20 12:30:58.999 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunLua <0x74781520>
08 04/13/20 12:30:58.999 JobHandler_LuaUPnP::HandleActionRequest argument id=lu_action <0x74781520>
08 04/13/20 12:30:59.000 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x74781520>
08 04/13/20 12:30:59.000 JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x74781520>
08 04/13/20 12:30:59.000 JobHandler_LuaUPnP::HandleActionRequest argument Code=luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“0” },394) <0x74781520>
08 04/13/20 12:30:59.001 JobHandler_LuaUPnP::HandleActionRequest device: 394 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x74781520>
08 04/13/20 12:30:59.001 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=0 <0x74781520>
50 04/13/20 12:30:59.001 luup_log:377: ALTHUE: debug: UserSetPowerTarget(394,0) <0x74781520>
50 04/13/20 12:30:59.002 luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,0) <0x74781520>
50 04/13/20 12:30:59.002 luup_log:377: ALTHUE: debug: HueLampSetState(394,{“on”: false}) <0x74781520>
50 04/13/20 12:30:59.002 luup_log:377: ALTHUE: debug: ALTHueHttpCall(377,PUT,lights/4/state,{“on”: false}) <0x74781520>
50 04/13/20 12:30:59.003 luup_log:377: ALTHUE: debug: Calling Hue with PUT URL_/lights/4/state , body:{“on”: false} <0x74781520>
50 04/13/20 12:30:59.030 luup_log:377: ALTHUE: debug: request:1 <0x74781520>
50 04/13/20 12:30:59.030 luup_log:377: ALTHUE: debug: code:200 <0x74781520>
50 04/13/20 12:30:59.030 luup_log:377: ALTHUE: debug: data:[{“success”:{“/lights/4/state/on”:false}}] <0x74781520>

Turning on:
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },394)
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunLua <0x74781520>
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest argument id=lu_action <0x74781520>
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x74781520>
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x74781520>
08 04/13/20 12:40:30.652 JobHandler_LuaUPnP::HandleActionRequest argument Code=luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },394) <0x74781520>
08 04/13/20 12:40:30.652 JobHandler_LuaUPnP::HandleActionRequest device: 394 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x74781520>
08 04/13/20 12:40:30.652 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x74781520>
02 04/13/20 12:40:30.653 JobHandler_LuaUPnP::ConfirmGlobalActionRules replaced binary on with dim 100 <0x74781520>
50 04/13/20 12:40:30.653 luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,100) <0x74781520>

If I press the On Icon for the device on the web the result in the log looks the same:

08 04/13/20 12:56:39.409 JobHandler_LuaUPnP::HandleActionRequest device: 394 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x74381520>
08 04/13/20 12:56:39.409 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=394 <0x74381520>
08 04/13/20 12:56:39.409 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x74381520>
08 04/13/20 12:56:39.409 JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x74381520>
08 04/13/20 12:56:39.410 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x74381520>
08 04/13/20 12:56:39.410 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.7989457428763926 <0x74381520>
02 04/13/20 12:56:39.410 JobHandler_LuaUPnP::ConfirmGlobalActionRules replaced binary on with dim 100 <0x74381520>
50 04/13/20 12:56:39.411 luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,100) <0x74381520>

Please advise on what to do next.

I think you need to ask VERA support what is the "ConfirmGlobalActionRules replaced binary on with dim 100 " message and why they do that. this does not come from my plugin and I would like the SetPowerTarget() to be called, not the SetLoadLevelTarget()

more over, I would like to see what happens in ALTHUE logs after the line to what calls are being made in ALTHUE to the Hue hub and the response
50 04/13/20 12:40:30.653 luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,100) <0x74781520>

Also would like to know what is the exact device_type of that particular device and the Hue Lamp model

thanks

Thank you for your reply.

Do you mean that this "ConfirmGlobalActionRules replaced binary on with dim 100" does not happen for you if you execute “luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },394)

This is the log for the next minute or so, I cannto find anything related there but I’m not an expert:

08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunLua <0x74781520>
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest argument id=lu_action <0x74781520>
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x74781520>
08 04/13/20 12:40:30.651 JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x74781520>
08 04/13/20 12:40:30.652 JobHandler_LuaUPnP::HandleActionRequest argument Code=luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },394) <0x74781520>
08 04/13/20 12:40:30.652 JobHandler_LuaUPnP::HandleActionRequest device: 394 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x74781520>
08 04/13/20 12:40:30.652 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x74781520>
02 04/13/20 12:40:30.653 JobHandler_LuaUPnP::ConfirmGlobalActionRules replaced binary on with dim 100 <0x74781520>
50 04/13/20 12:40:30.653 luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,100) <0x74781520>
06 04/13/20 12:40:30.943 Device_Variable::m_szValue_set device: 103 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: Watts was: 0.0 now: 0.0 #hooks: 1 upnp: 0 skip: 0 v:0x12a40a8/NONE duplicate:1 <0x771c2520>
06 04/13/20 12:40:30.943 Device_Variable::m_szValue_set device: 103 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: ActualUsage was: 1 now: 1 #hooks: 0 upnp: 0 skip: 0 v:0x1113cd0/NONE duplicate:1 <0x771c2520>
04 04/13/20 12:40:30.944 <0x771c2520>
02 04/13/20 12:40:30.945 Device_Basic::AddPoll 103 poll list full, deleting old one <0x771c2520>
06 04/13/20 12:40:30.945 Device_Variable::m_szValue_set device: 103 service: urn:micasaverde-com:serviceId:HaDevice1 variable: PollRatings was: 5.00 now: 5.00 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x771c2520>
06 04/13/20 12:40:30.946 Device_Variable::m_szValue_set device: 103 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: LastPollSuccess was: 1586774320 now: 1586774430 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x771c2520>
06 04/13/20 12:40:30.947 Device_Variable::m_szValue_set device: 103 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: ConsecutivePollFails was: 0 now: 0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x771c2520>
04 04/13/20 12:40:52.224 <0x771c2520>
02 04/13/20 12:40:52.224 Device_Basic::AddPoll 132 poll list full, deleting old one <0x771c2520>
06 04/13/20 12:40:52.225 Device_Variable::m_szValue_set device: 132 service: urn:micasaverde-com:serviceId:HaDevice1 variable: PollRatings was: 5.00 now: 5.00 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x771c2520>
06 04/13/20 12:40:52.225 Device_Variable::m_szValue_set device: 132 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: LastPollSuccess was: 1586774342 now: 1586774452 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x771c2520>
06 04/13/20 12:40:52.225 Device_Variable::m_szValue_set device: 132 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: ConsecutivePollFails was: 0 now: 0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x771c2520>
04 04/13/20 12:41:22.220 <0x771c2520>
02 04/13/20 12:41:22.220 Device_Basic::AddPoll 45 poll list full, deleting old one <0x771c2520>
06 04/13/20 12:41:22.221 Device_Variable::m_szValue_set device: 45 service: urn:micasaverde-com:serviceId:HaDevice1 variable: PollRatings was: 5.00 now: 5.00 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x771c2520>
06 04/13/20 12:41:22.221 Device_Variable::m_szValue_set device: 45 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: LastPollSuccess was: 1586774372 now: 1586774482 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x771c2520>
06 04/13/20 12:41:22.222 Device_Variable::m_szValue_set device: 45 service: urn:micasaverde-com:serviceId:ZWaveNetwork1 variable: ConsecutivePollFails was: 0 now: 0 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:1 <0x771c2520>

All Parameters for this device:
name Hue Hall 1
device_type urn:schemas-upnp-org:device:DimmableRGBLight:1
altid 00:17:88:01:03:xx:xx:xx-xx
ip
mac
manufacturer Signify Netherlands B.V.
model LCT015
id_parent 377
nobulk
embedded
disabled
restricted
device_file D_DimmableRGBALTHue1.xml
id 394
room 0
impl_file
time_created 1586763228
device_json D_DimmableRGBALTHue1.json
local_udn uuid:4d4xxxxx-5342-xxxx-018a-000002xxxxx5
category_num 2

Try to set variable urn:upnp-org:serviceId:Dimming1 TurnOnBeforeDim to 1.
This should force it.

something still wrong, something is doing this and it is not me. “ConfirmGlobalActionRules replaced binary on with dim 100” and ALTHUE does not seem to do anything after the line 50 04/13/20 12:40:30.653 luup_log:377: ALTHUE: debug: UserSetLoadLevelTarget(394,100) <0x74781520>. as if that device was not capable of dimming.

can you confirm the device ID, the device_type and the Hue device data ( in the altHue device tab ) please

please I have a theory, it seems it tries to set dim level to 100 instead of powering on and I also believe its “urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus” value is probably already 100 therefore ALTHUE decide to do nothing. can you please check this theory ? maybe after a power off, force this variable to be 0 to see what happens when you power on. but I think the culprit is that ConfirmGlobalActionRules. I am checking on my system but I do not see this kind of behavior

Thanks for you help, but same behavior as before when I send
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },394)
The lamp does not turn on.
image

I’m not sure what you would like to see, this?



I will check your theory tomorrow.

Yes, you are right!
If I set LoadLevelStatus to 0 the lamp turns ON by sending
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },394)
If LoadLevelStatus is anything else than 0 the lamp stays off when the same command is sent.

can you try the GitHub version v1.50 ?
if it still does not work, I am interested by the capture of the logs in DEBUG mode around the action that sets the power to 0. normally that action should set the LoadLevelStatus to 0 as well and then the switch ON should work. we need to understand why this is not happening. what triggers or how do you sets the power to 0.