UniversalDevicesInc-PG3 / udi-poly-ELK

MIT License
2 stars 1 forks source link

ELM M1G System Trouble Status #78

Closed myriaxis closed 2 years ago

myriaxis commented 2 years ago

Hi, I just installed the ELK nodeserver on my Polisy and I noticed the System Trouble Status attribute doesn't seem to be mapped. Using Home Assistant Integration, I was able to get it. Is it possible to add it?

myriaxis commented 2 years ago

Hello, Has someone picked up this issue?

jimboca commented 2 years ago

Sorry, out of town, will take a look when I'm back.

myriaxis commented 2 years ago

Thanks, let me know if I you need additional information.

jimboca commented 2 years ago

Added the hooks to detect this in 3.3.6 but need to initiate some trouble to test... Will try this weekend.

jimboca commented 2 years ago

I'm conflicted on what to do. How should this be displayed? Should each individual trouble status be displayed with true/false, or should there be one that displays the latest trouble status? Have you upgraded to 3.3.6? If so, and you have time can you generate a trouble? It should show a warning in the log, and send that to me?

myriaxis commented 2 years ago

Hi jimboca, thanks for looking into this. I will upgrade to 3.3.6, but can only test AC Power Failure for now. I might be able to test Low Battery in a few days when my batteries are depleted. I'm not sure what the ELK sends under Trouble Status attribute, but I think it's a list of text messages. You can simply report that list and we write a program to decipher the list. It's tedious for the programmer, but if the list of messages change, your code doesn't need change. Or, what I would prefer, is a true/false status for each trouble that I can use in programming conditions. This way I can group the troubles in different groups requiring different responses. I'll let you know how 3.3.6 goes. edit: sorry, I'll let you know how 3.3.8 goes.

myriaxis commented 2 years ago

OK, I did the AC Failure test and no warning was shown in the log. My logging is set to the default level. Should I set it to a different level? Also, in Poliglot V3, I see that I have ELK v3.3.8, how do I verify that version in Polisy?

myriaxis commented 2 years ago

Sorry, I looked in the Polisy log, not the Poliglot V3 log for ELK. Here is what I got: 2022-07-26 21:09:16,044 Thread-3 udi_interface WARNING Controller:wm: outputs not defined, so none will be added 2022-07-26 21:09:19,564 ELK-78489 udi_interface WARNING Controller:sync_complete: ELK Controller: Sync of panel is complete, adding nodes... 2022-07-26 21:09:19,734 ELK-78489 udi_interface WARNING Controller:sync_complete: ELK Controller: All nodes added, ready to go... 2022-07-26 21:19:47,542 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail'}

jimboca commented 2 years ago

Thanks that's what I was hoping to see. I know what ELK sends, but wasn't completely sure how the ELK Module I use would report it to me.
What I was really wondering was how Home Assistant was showing it to you? With ISY I can't "report that list" there isn't a way to do that. So I can only have one status that flips to the value like 'AC Fail' when it happens, then you can write a program to notify yourself when that value changes. But if you have another trouble it will change to the latest trouble reported. That's actually what I have implemented now, and can release soon. Or I can change it to a status for each possible failure and use true/false but that seems like overkill?

jimboca commented 2 years ago

My current method almost works, just need to test again, but need to call monitoring company to put it in test mode again so they don't get mad and call me when I unplug it :)

myriaxis commented 2 years ago

From what I can tell, Home Assistant provides the list of troubles. In other words, my understanding is that troubles can cumulate, thus you would have multiple items in the list. For example, AC Fail could be eventually listed with Low Battery Control. In terms of programming, AC Fail would mostly be used as an advanced warning (e.g. push notification) of an eventual Alarm System failure, while Low Battery Control could be used to initiate protective actions. I know that having a True/False per trouble is a bit too much, but all troubles do not call for the same actions. For example, having an AC Fail and after a while a low battery do not mean the same thing as having a low battery before an AC Fail. Low battery after AC Fail just means the battery has run out of energy, while low battery before AC Fail means the battery needs to be changed. So, it is important to be able to act on each trouble separately. In a short while, I will hopefully get a low battery warning. I have a 17 Ah backup battery ( 9Ah + 8 Ah in parallel) that seems to last approx 24h. I'll report the log when that happens.

jimboca commented 2 years ago

Yes, make sense to have all listed, although same notifications could be handled if listed in one status, it's just that you couldn't see then all at once the AC.

But the other issue is I don't think it reports back when the trouble status has been cleared...

myriaxis commented 2 years ago

With Home Assistant, for example, the AC Fail message disappears when AC is restored. I'm not sure what you can do, but from a program perspective, it would be necessary to catch the event of a new message. Let say we have no trouble message in the status. Then if power is lost, we have an event saying that the message AC Fail has been added to the list. After that, the battery is running low, then we should have an event saying that a new message has been added to the list. If the power is restored, a new event would say that the message AC Fail has been removed from the list. Since the battery is still low and now recharging, the message low battery should remain in the list, thus not creating an event. When the battery rises over the low battery threshold, then a new event should say the message is gone.

myriaxis commented 2 years ago

I agree that there are a lot of trouble messages. For most of them, I will simply push a notification to my phone to make sure I'm aware of the problem(s) and taking action to remediate. But specifically for AC Fail and Low Battery, I want to be able to automatically restart the alarm system once power is restored while I'm away.

jimboca commented 2 years ago

Ok, if you have another log showing an trouble happen, then when it clears please grab those lines and post here or PM the entire log to me on the forum or email.

jimboca commented 2 years ago

If you don't then I'll call and put mine in test mode to see what comes thru.

myriaxis commented 2 years ago

Hello. here is what I got this morning: 2022-07-28 03:02:47,363 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} 2022-07-28 03:02:56,329 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'Low Battery Control'} 2022-07-28 03:03:18,329 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} The system is still active after 36 hours. What happened to the previous lines in the log. I was expecting to see the lines of the past few days?

myriaxis commented 2 years ago

If I put the power back on, I get this: 2022-07-28 03:02:47,363 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} 2022-07-28 03:02:56,329 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'Low Battery Control'} 2022-07-28 03:03:18,329 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} 2022-07-28 09:08:31,732 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'Low Battery Control'} 2022-07-28 09:08:34,776 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': ''} The Low Battery didn't stay on very long, I'll try to keep the system on battery for a little while longer and see what happens.

myriaxis commented 2 years ago

Here is the log again. I added the line from 2022-07-26. 2022-07-26 21:19:47,542 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail'} 2022-07-28 03:02:47,363 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} 2022-07-28 03:02:56,329 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'Low Battery Control'} 2022-07-28 03:03:18,329 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} 2022-07-28 09:08:31,732 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'Low Battery Control'} 2022-07-28 09:08:34,776 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': ''} 2022-07-28 09:15:53,946 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail'} 2022-07-28 09:16:59,006 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} 2022-07-28 09:17:07,975 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'Low Battery Control'} 2022-07-28 09:17:29,985 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'}

During the course of this log: 2022-07-26 21:19:47,542 - I removed AC power to the ELK 2022-07-28 09:08:31,732 - I restored AC power to the ELK 2022-07-28 09:15:53,946 - I removed AC power to the ELK

I noticed that when the "Low Battery Control" message is triggered, the "AC Fail" message disappears for 30 seconds. That is a bit unexpected. I'll keep my system on battery until they run out and see what is logged.

jimboca commented 2 years ago

Ok, perfect, this is what I was really wondering about: 2022-07-28 09:16:59,006 ELK-78489 udi_interface WARNING Controller:callback: ELK Controller: Unhandled callback: cs={'system_trouble_status': 'AC Fail, Low Battery Control'} I can add code to parse that comma separated list to know the current trouble status's. I could tell from the API code I'm using how that would work but this makes sense and makes having a status message for each one usable.

jimboca commented 2 years ago

It's all coded, but not tested yet. Hopefully I will have time to call and put mine in test mode tomorrow night, but not sure how long it takes for my low battery to happen so I can confirm that it properly sets multiple troubles and then clears them.

It make for a very full Controller status page! You need a high resolution monitor to see it all! image

jimboca commented 2 years ago

I have released to non-production store, so you can install it in a new slot and test if you like.

myriaxis commented 2 years ago

I'd like to try, but the version I see in non-production store is 3.3.8, same as the version I have now. Also, I can't install it unless I buy it?

jimboca commented 2 years ago

I neglected to change the version when I sent it to beta store, but it is actually 3.4.0 The current store doesn't handle this well, next version has more features to support this, but you should be able to install it since I made it free for a month?

myriaxis commented 2 years ago

I guess I don't quite understand how this PG3 nodeserver purchase works. I'm on the PG3 nodeserver non-production list. I see "Installed ELK(2)" and a "purchase" icon beside your ELK module. When I click on "purchase", I get an error saying nodeserver info not valid. Is it because I already have your module installed?

jimboca commented 2 years ago

I'll ask the developer and get back to you.

jimboca commented 2 years ago

Is that the exact error message?? The string "info not valid" does not appear in the PG3 source anywhere.

myriaxis commented 2 years ago

"Purchase failed: Node Server info is not valid.." in the red notification bubble that stays on for 5 seconds.

jimboca commented 2 years ago

Sorry @myriaxis, haven't heard back from Bob yet, not sure what the issue is. But at least now I've had time to test two troubles coming through. This version is updated in beta if we can ever figure out how you can install it. There are more changes for other changes I want to complete before releasing.

image

myriaxis commented 2 years ago

No worries. You said the module was free for a month, but it still shows as "Purchase". Under Installed, I see ELK(2). Maybe the problem is caused by the fact that I asked the system to install a non-production on a production version. How can I force the choice of another slot and have in essence two version of ELK running?

jimboca commented 2 years ago

It should bring up a form that allows you to select a different slot? That's what it does for me, but since I am the owner it shows Install, not Purchase.

myriaxis commented 2 years ago

I clicked the DSC-IT100 module (free) and it gave me the option to select a slot and install it. I guess the problem is that to install this new non-production version I have to register a purchase it, even if it's free. But since I already own it on the production side, there is an inconsistency.

jimboca commented 2 years ago

Yes, he's aware of the inconsistencies but thought this would work, but obviously it doesn't. I'll run it on my development environment for a day then release to production. It actually failed last night and I fixed and enhanced a lot of things. I wanted to get setting chime mode working, but that's proven to be more difficult then I thought..

jimboca commented 2 years ago

Try to install beta again, the developers have hopefully fixed this.

I've just about got Chime mode all working, I had to make changes to some shared code I use so I won't be able to release another version until he approves of those changes and releases his code.

myriaxis commented 2 years ago

I was able to install the beta version in slot 3. I added the nodes and got the ELK Controller to show the statuses. I unplug the AC adapter and the AC FAIL flag shows TRUE. I'll wait until I get the Low Battery Control flag set to TRUE (about 2 days) and report.

jimboca commented 2 years ago

Awesome, thanks.

jimboca commented 2 years ago

I'm closing this, but if you find issues when yours reports please re-open. Thanks for all your help!

jimboca commented 2 years ago

Should all be working in 3.4.4, please confirm if you can, otherwise I will run more tests tomorrow.