rooi / homebridge-lightwaverf

LightwaveRF plugin for HomeBridge
9 stars 7 forks source link

Ability to send the Room all off command #54

Open AKWillows opened 1 year ago

AKWillows commented 1 year ago

I love this plug-in and currently use it for Lightwave lighting throughout the house. Thank you!

I have one thing, though, that I wish I could do and I have never found a way to do it. Because we also use the wall switches, and as the Connect Series devices have no feedback, the light status in HomeKit is often wrong. That in itself is no issue for me as I know it cannot send status back to the plug-in.

However, this means that when I use my “Goodnight’ scene in HomeKit which is supposed to turn everything off, the command doesn’t get sent to all of the individual lights as HomeKit thinks some are already off.

What I would love is a switch in HomeKit that would automatically send the “Room all off” command that is available in The Lightwave API. I have tried various UDP Sender plug ins but none seem to work effectively - and none have been updated for several years.

Has anyone else managed to solve this? Or could something be added to this plugin?

rooi commented 1 year ago

Hi, from what I remember, the homekit state should not matter when using a Homekit scene to switch devices on or off. Could you please check the log and see if all commands are send? If this is the case, increasing the timeout in the config may help to prevent interference between subsequent commands.

I hope this helps. I'm moving away from the lightwaverf ecosystem and only have on dimmer left in my home, so it is difficult to test this myself. Could you please test the logs? If the issue still persists I can try to add the turn all off switches to the plugin as you suggested.

Thanks!

AKWillows commented 1 year ago

Hey - thanks very much for your reply. Appreciate very much that you are helping even though you are moving away from the platform.

As you suggested, I've taken a look at the logs and it seems that, provided HomeKit thinks at least one device is switched on, it will send the command to turn off every device in the scene when I trigger my HomeKit "All Off" scene. However, if HomeKit thinks everything is already off, then it sends nothing. In the attached file, you can see that I turn on two devices in homeKit then execute the All Off scene and it then sends the off command to each device in the scene/room. So, there is a workaround... I could just make my automation turn on a device before executing the all off scene.

Your comment about timeout is interesting - because I have never had that configured! I can see that it appears you can add an overall timeout figure or one on each device. Which would you suggest? Does the timeout on the device put in a delay before executing the next command?

Screenshot 2023-03-12 at 15 06 46
AKWillows commented 1 year ago

For the above screenshot I added Timeout:1000 in the header part of the Lightwave JSON

rooi commented 1 year ago

Hi, thans for testing! The timeout indeed adds a delay before executing a command, which triggers the error. By my knowledge it does not cause any other significant negative side effects, which is why I did not changed the implementation to something better/faster.

About the turnRoomOff switch. I've just pushed a commit that should allow to do this using a workaround. Please check the readme at the bottom. Trick is, add a device type switch "S", put in the correct room number and use a negative (-1) device number. Then a switch should be added that allows you to turn that room off. Please note, that it is just a quick workaround. The dummy switch keeps the last value, for example.

Are you able to pull the last commit and test it? Please let me know how it goes, and remember to backup you config and such. I did not push it to npm yet, but if it works we can do that, since this workaround is unlikely to bother others.

Thanks!

AKWillows commented 1 year ago

Hi

I really appreciate you doing that - it sounds like a neat solution!

Having said that, although I have a fair bit of tech knowledge, I’m not sure how to “pull the last commit” as I usually just use the standard update route for plugins from the Homebridge. Sorry to ask, but could you help with how I would do that? I run HomeBridge on a RaspberryPi using HOOBS. I was thinking that I would probably just install on a new child bridge so that it doesn’t interfere with my current config - which is all fully backed up anyway!! :-)

Andrew

rooi commented 1 year ago

Hi Andrew,

I understand. I've just published the latest version since I'm very confident it should not cause any problems for others. If you could please test is as soon as possible and let me know if it works like before and afterwards with the new dummy switch than we can be sure. You should be able to update like you did before in HOOBS.

Thanks!

Roy

AKWillows commented 1 year ago

Hey there!

It takes a little while for the update to show in HOOBS. Have updated now and all seems to be working fine both before and after adding the new dummy switch. I can see in the logs that the "all off" command is sent properly and it functions just as intended. Will continue to keep an eye on it but no reason for there to be any issue now.

Hopefully it will be useful to some other users too.

You are a total star! Thanks so much :-)