@wags1
What messages were sent and received, up to 2 mins before and after the time the switch flipped.
The state of PowerOff switches to off at 2:20:16.000 PM EDT and then switches to on at 2:21:17.000 PM EDT. Their are honestly lots of entries in the Bridge log 2 mins before and after that time. Is their something specific I need to look for or is their an easy way for me to send it all to you?
I have been running the CLI to log the driver overnight for the last few nights together with a couple of rules to alert me to these events happening.
There are a lot of events being logged (looks like state refreshes?) but have not seen the ârogueâ behaviour⌠yet!
Needless to say the night I forget to turn logging on itâll happen
I have had a phantom switch change myself now, I had âverbose sent/recd logsâ turned on, but not full logging by logcat.
I can see that no message was received from Harmony that could have triggered it - which at first seemed like bad news.
I then went through and re-read the source code, to check for possible causes and I think there is only one other thing that can cause it - can I just check with you both that when you have experienced this a running activity went from âonâ to âoffâ incorrectly, and this has never happened the other way around that you have noticed?
What I think is causing this, during the device_init process I set the switch status to off, so that it has a state when an activity device is very first created - as they are created neither on or off - and the UI cannot display that. However that same method is also called whenever the hub reboots, driver restarts or driver is updated. Iâm not sure which of these events is happening overnight for you (or am I even 100% that this is the cause)
See this line of code SampleDrivers/init.lua at 14ebd5873c40a09544cdb71680971bb7e291e330 ¡ lrmulli/SampleDrivers ¡ GitHub
Next time I work on the driver (probably tomorrow), I will remove this line of code, and also add a sent-receive log item to say the driver is initialising. I will then publish an update. Hopefully this will stop the issue occurring.
Louis
Hi,
In my case there shouldnât have been any running activities as it has been overnight every time. I only noticed it as I have lighting routines linked to the main harmony power and I was waking up with lights âincorrectlyâ on!
So in your instance presumably your poweroff activity turned from on to off?
Louis
Yep I believe so, with seemingly no corresponding activity on⌠BUT, this was not really monitored behaviour, the on triggered my lights in âtv modeâ in the early hours. I had been refactoring my routines with the new Hue/Sonos and your LAN drivers and at the time put it down to network/driver/ST âblipsâ that would settle.
It wasnât until @wags1 posted I thought, hang on Iâve seen something similar. It has happened maybe 3 or 4 times (so not constantly) and always when there would not have been any related activity through ST and definitely no Harmony use.
Ok, I will post when I have completed the change detailed above
Yes, PowerOff is normally on and when the issue occurs it goes from on to off and then back on. The reason I notice the issue is that I have a Routine that watches for PowerOff to turn on and then initiates a ST Scene that turns certain lights off and other lights on in my HT/Man Cave (I posted the Routines a few posts back and the specific one is called âNew- Watch TV Lights Offâ).
Here you go this is what I have seen (@ 4:02 on Thursday and then 2:30 and 08:59 on Friday):
and am seeing off-on-off sequence in normal use:
which would match?
Yes it does, thank you
The reason it flips back 1 minute later is, every 60s it polls the harmony hub for the current activity - so it would correct itself. Iâll fix the code in the morning.
Did you make sure that when you tried to add it back, that you first enabled âget config on connectâ and waited for the config to be retrieved? Before adding the activity back?
Driver Update 13/10/22:
I have removed the defaulting of the activity switches to âoffâ as this was causing problems for users who trigger automations based upon the status of activities, as they were defaulting back to âoffâ for 1 minute everytime the driver re-initialised itself.
This does mean when you add new activity devices, their status will be neither âonâ or âoffâ until their true status is returned from the harmony hub which should take no longer than 60s. Unfortunately the smartthings app UI cannot handle a switch being neither âonâ or âoffâ, so will display an error instead of the switch status for the first minute after it is added.
I think this is a price worth paying for more accurate activity status.
The driver will update automatically, you can force it through the app or cli if you want it now.
@wags1 @TheHundredthIdiot thanks for providing input into understanding what was going on here.
The driver has become extremely reliable with activity status now. Iâm running 3 hubs, and it seems to be reporting status accurately.
Thanks!
@Weboperations
Thatâs made my day, I was worrying about you 3hubers
I think the reconnect code, coupled with the re-initialisation fix should have really helped. But itâs really hard to know for sure without being able to test multiple hub setups
Iâve been waiting for the dust to settle on this. I have four hubs and will be diving in with your driver soon.
Thank you for your work on this. I have a lot tied-in with Harmony.
I canât comment on multiple hubs as I only have 1 but it definitely has become very stable and is working perfectly for me. Thanks @lmullineux !
@lmullineux has done some tremendous work . I use my harmony activities daily in my movie room and works flawlessly. Canât be happier!! You rock sir
Another thank you, I use Harmony (single hub) daily with Hue and Sonos automations and your driver has been a godsend⌠Loosing this functionality with the groovy shutdown would have been a serious negative for me.
@lmullineux you do, indeed, rock!
I have still been unable to consistently use PowerOff to initiate my TV Off lighting Scene without undue delays or false initiations. I have switched to simply watching for all my Actvities to switch off. In order to prevent initiation of the TV Off Scene when switching between Actvities I needed to add in some delay. 8 seconds seems to work consistently but you can probably experiment with the delay time to make it a bit less depending on your environment. The routine is below. Hope it helps someone.