Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with simulated notifications #49

Closed
Cimpel opened this issue Dec 12, 2024 · 35 comments · Fixed by hostcc/pyg90alarm#45
Closed

Error with simulated notifications #49

Cimpel opened this issue Dec 12, 2024 · 35 comments · Fixed by hostcc/pyg90alarm#45
Assignees
Labels
bug Something isn't working

Comments

@Cimpel
Copy link

Cimpel commented Dec 12, 2024

Got the next error message:

Logger: pyg90alarm.device_notifications
Bron: runner.py:154
Eerst voorgekomen: 12:46:39 (1 gebeurtenissen)
Laatst gelogd: 12:46:39

Received alert from wrong device: expected 'GA180198G000708', got ''

@hostcc hostcc self-assigned this Dec 12, 2024
@hostcc hostcc added the bug Something isn't working label Dec 12, 2024
@Cimpel
Copy link
Author

Cimpel commented Dec 12, 2024

And the next one:
Logger: pyg90alarm.alarm
Bron: runner.py:154
Eerst voorgekomen: 14:23:23 (1 gebeurtenissen)
Laatst gelogd: 14:23:23

Exception simulating device alerts from history: ValueError('11 is not a valid G90AlertSources')

@Cimpel Cimpel closed this as completed Dec 12, 2024
@hostcc
Copy link
Owner

hostcc commented Dec 12, 2024

@Cimpel , thanks for reporting the issue - I'll focus on first error, 2nd one is due to the component (actually, the Python library it uses) doesn't recognize that event though I might be able to look around to add support for it as well.

To help me understanding the issue better:

  • How often you see the error Received alert from wrong device?
  • Does it happen under specific conditions, e.g. right after HomeAssistant restart, alarm triggered or any other happenings?
  • Could you please download the diagnostic data from the component and post it here? The data won't contain anything sensitive so it is safe to share it. Settings -> Devices & services -> Golden Security Alarm -> three dots at the right of your alarm panel -> Download diagnostics

@hostcc hostcc reopened this Dec 12, 2024
@Cimpel
Copy link
Author

Cimpel commented Dec 12, 2024 via email

@Cimpel
Copy link
Author

Cimpel commented Dec 12, 2024 via email

@hostcc
Copy link
Owner

hostcc commented Dec 12, 2024

Unfortunately the attachment didn't seem to get through

@Cimpel
Copy link
Author

Cimpel commented Dec 12, 2024 via email

@hostcc
Copy link
Owner

hostcc commented Dec 13, 2024

Tired to paste the log directly into Github. Did you get it ?

Still none show up in the issue, sorry for bad news.

@Cimpel
Copy link
Author

Cimpel commented Dec 13, 2024

Another try , I tested in the preview and it downloaded, fingers crossed

home-assistant_gs_alarm_2024-12-12T17-11-58.241Z.log

@hostcc
Copy link
Owner

hostcc commented Dec 13, 2024

Another try , I tested in the preview and it downloaded, fingers crossed

home-assistant_gs_alarm_2024-12-12T17-11-58.241Z.log

This one came thru finally, thanks! Although that is from debug logging on the component, while diagnostic data would be needed - you can take it from Settings -> Devices & services -> Golden Security Alarm -> three dots at the right of your alarm panel -> Download diagnostics, please.

@Cimpel
Copy link
Author

Cimpel commented Dec 13, 2024

You mean this one ?

home-assistant.log

@hostcc
Copy link
Owner

hostcc commented Dec 14, 2024

@Cimpel , thanks much - the last log is very helpful, I see now diagnostics can't be downloaded for the same reason (entity with unrecognized source field).

I've made another component version 1.22.1, would be great if you could test it - please note it is marked as pre-release, so you'll need to select it explicitly in HACS (HACS -> Golden Security Alarm -> Redownload -> 1.22.1) assuming you've used that method of component installation.

@Cimpel
Copy link
Author

Cimpel commented Dec 14, 2024 via email

@Cimpel
Copy link
Author

Cimpel commented Dec 14, 2024

The diagnostics from 1.22.1

home-assistant.log

@hostcc
Copy link
Owner

hostcc commented Dec 14, 2024

Unfortunately the 1.22.1 release didn't solve the problem, see the message from the logbook. Logger: pyg90alarm.device_notificationsBron: runner.py:154Eerst voorgekomen: 11:43:06 (1 gebeurtenissen)Laatst gelogd: 11:43:06Received alert from wrong device: expected 'GA180198G000708', got '' I will upload the diagnostic log separately.

Apologies for a confusion - the 1.22.1 will only resolve Exception simulating device alerts from history: ValueError('11 is not a valid G90AlertSources') part of the story, will switch the wrong device ID shortly.

@hostcc
Copy link
Owner

hostcc commented Dec 14, 2024

Actually - just found that proper SOS handling is missing (thanks again for helpful logs!), will try to implement those today and that should cover diagnostics/ValueErrors.

@Cimpel
Copy link
Author

Cimpel commented Dec 14, 2024 via email

@Cimpel
Copy link
Author

Cimpel commented Dec 16, 2024

Just got a new error, something with SOS etc. See the attached log

Logger: pyg90alarm.history
Bron: runner.py:154
Eerst voorgekomen: 10:05:02 (1 gebeurtenissen)
Laatst gelogd: 10:05:02

Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1734339897, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1734339897, '')')

home-assistant.log

@hostcc
Copy link
Owner

hostcc commented Dec 16, 2024

Just got a new error, something with SOS etc. See the attached log

Logger: pyg90alarm.history Bron: runner.py:154 Eerst voorgekomen: 10:05:02 (1 gebeurtenissen) Laatst gelogd: 10:05:02

Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1734339897, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1734339897, '')')

home-assistant.log

hm, seems related to RFID, the hardware I don't have - I'll try to best guess how panel works with those, but we likely need a few trials and errors.

Meanwhile, mostly finished my work re: SOS (sorry it takes longer then I initially committed to) - should be able to finish it today. That will remove failures downloading the diagnostics and errors in the HASS related to simulating events from history - we can then iterate over the remaining issuses.

@hostcc
Copy link
Owner

hostcc commented Dec 16, 2024

@Cimpel , 1.22.2 is out (same upgrade process as previously) - hopefully it'd fix wrong device GUID and history processing issues, except source=11 (RFID), will need more help with that, since I don't have that HW.

@Cimpel
Copy link
Author

Cimpel commented Dec 17, 2024 via email

@Cimpel
Copy link
Author

Cimpel commented Dec 17, 2024

Herewith the log (seems much better now):

config_entry-gs_alarm-01JA303EDWD0NA9B44GVCKMAMB.json

@Cimpel
Copy link
Author

Cimpel commented Dec 17, 2024

Found some additional messages:

Deze fout is ontstaan door een aangepaste integratie.

Logger: pyg90alarm.history
Bron: custom_components/gs_alarm/diagnostics.py:52
integratie: Golden Security Alarm (documentatie, problemen)
Eerst voorgekomen: 10:25:23 (13 gebeurtenissen)
Laatst gelogd: 10:25:23

Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1733830473, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1733830473, '')')
Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1733758235, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1733758235, '')')
Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1733746310, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1733746310, '')')
Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1733498264, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1733498264, '')')
Can't interpret '6' as alert state (decoded protocol data 'ProtocolData(type=4, event_id=12, source=11, state=6, sensor_name=' Keypad-', unix_time=1733325574, other='')', raw data '(4, 12, 11, 6, ' Keypad-', 1733325574, '')')

Strange, because the keypad was not used !?

@hostcc
Copy link
Owner

hostcc commented Dec 17, 2024

Thanks much, @Cimpel ! The Can't interpret '6' as alert state... should be harmless (would affect diagnostics only, events simulation doesn't use that code) and likely related to RFID not yet being supported.

Other than that , do you still see some issues with the components? I guess at this time you should see sensors (again RFID) reporting their activation/deactivation (though with a slight delay, that is how simulation works) - could you please confirm that? Please don't hesitate to add more details if needed.

@Cimpel
Copy link
Author

Cimpel commented Dec 17, 2024 via email

@Cimpel
Copy link
Author

Cimpel commented Dec 17, 2024 via email

@hostcc
Copy link
Owner

hostcc commented Dec 17, 2024

@Cimpel , thanks heaps for being patient - I have been overlooking (now obvious) place of the code where the device GUID has been mismatching. It should now be fixed, 1.22.3 is out - please give it a try (the update process is as before), hopefully it'd bring a better experience.

@Cimpel
Copy link
Author

Cimpel commented Dec 17, 2024

The message in the system logbook expected 'GA180198G000708', got '' does not appear again (only the keyboard message is there)
However still no log of the sensor open/close in the GS logbook or history visible.

@hostcc
Copy link
Owner

hostcc commented Dec 18, 2024

However still no log of the sensor open/close in the GS logbook or history visible.

Unfortunately the mode comes with its limitations, basically what ends up in panel's history will be reflected:

  • Only wireless door sensors send open/close alerts
  • Cord sensors don't send those alerts
  • Motion sensors don't send those either
  • Panel state changes (alarm/disarm/etc) send corresponding alerts
  • There is a slight delay of several seconds before HASS will show state changes

Hence, with RFID not yet supported it leaves only wireless door sensors and panel state in the list. Plus, you might want to enable door open alerts in mobile application (alerts section) - that isn't required for normal setup (when panel is in same network segment as HASS), but might be helpful.

Hope that clarifies.

@Cimpel
Copy link
Author

Cimpel commented Dec 18, 2024 via email

@hostcc
Copy link
Owner

hostcc commented Dec 18, 2024

Thanks for testing the changes and sharing your findings, @Cimpel !

I understand the limitations. I tested with a wireless door sensor (nr 7 in the diagnostic log) which also has the "detect door&window" alert option in the app enabled. From these sensors no state changes are detected and are always reported as "closed".

My understanding of "detect door&windows" option is slightly different - if enabled on the sensor there will be notification if door/window is left open when panel is armed. While we're looking at enabling 'door open' alert in the panel configuration (iOS app names it 'Alarm alert'), not at the sensor level. Once enabled that should help reacting at wireless sensors at least.

I hoped to use your notifications to alert me that one of the windows or doors were left open on arming the alarm system.

Well, that isn't yet supported unfortunately - I plan to have it added in some near future. Though it poses another challenge - the panel will get armed despite detecting open door/window, we might consider reverting it to disarmed by means of component, doing just notifications etc. I don't think I have a concert solution here yet, just thoughts.

The original alerts I got from the 90B disappeared for some reason a while ago. Can this have to do because I installed the HA integration ? Maybe deinstall it to test if they are back again in that case

Unlikely because of HA integration, I wouldn't call mobile apps for the panel best in class, to be honest.

I like the HA integration because it's a nice backup for the app, as the app is not available on occasions due to server problems at Golden Security. The HA integration is local, so in that case it still enables me to control the alarm system.

Thanks, that is exactly the reason I've implemented the component ;) Although panel occasionally starts to timeout local commands sent by HA when their servers are down (not fatal, just annoys sometimes).

RFID is not a big issue for me.

Thanks for sharing, I do plan to have it at least initially implemented so you could test.

@Cimpel
Copy link
Author

Cimpel commented Dec 18, 2024 via email

@hostcc
Copy link
Owner

hostcc commented Dec 19, 2024

Thanks, @Cimpel - just checking, did it get better if you'd enable door open alerts at the panel level?

@Cimpel
Copy link
Author

Cimpel commented Dec 19, 2024 via email

@hostcc
Copy link
Owner

hostcc commented Dec 19, 2024

I did a test with the panel armed: Both when opening or closing the door when armed, I get a message in the logbook including the name of the corresponding sensor. So far so good. Thumbs up

Nice to hear, thanks!

Like said before it would be nice to also get a "close" message when a door/window is closed without the panel being armed. Thus you know proactiv for sure that the panel knows that the door/window is closed (and doesn't discover that during arming the panel).

Will implement such functionality (reacting to a window being open when the panel is being armed), if I understand you right.

The same for a "low battery" message. It would be nice that you could get a message that the sensor has a low battery so that you can change the battery timely. (originally these kind of messages were also sent by the panel to the app)

It is there already, though likely not well documented ;) each wireless sensor has low_battery attribute - it will be set to true if sensor reports such condition, though the attribute will reset to false upon HA restart. With that, you could do a custom automation when attribute changes to true - e.g. adding persistent notification etc. You can look at those attributes in Developer tools -> states in HA

@Cimpel
Copy link
Author

Cimpel commented Dec 19, 2024 via email

@Cimpel Cimpel closed this as completed Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants