You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like data from sector is not reliably set in the state
At some random point it is correctly set resulting in wrong automations triggered
Wrong data used in notifications (eg: User A turned off the alarm, when actually it was User B)
Seems like the data in sector API is correct (according to my expectations at least)
Details / debugging
I've set up an automation to notify when the state changes and it fires constantly without any state changes. It works correctly when state does change, but through the day there can be 0-{n} extra updates due to nothing. This makes it impossible to use as a reliable indication of the alarm state change.
Automations
Auto enable at 21:00
- id: auto-arm-alarm
alias: Auto Arm Alarm
trigger:
platform: time
at: "21:00:00"
action:
- service: alarm_control_panel.alarm_arm_home
entity_id: alarm_control_panel.sector_alarmpanel_XXXXXXX
Last night it was set partial armed by automation at 21:00, this morning disabled by Annie at 10:05. Yet all the logs show the user who last changed was home (this is the user I set up for HA that did arm the system). Then somehow at 14:34 (~4 hours later) it gets the right user (Annie) has changed resulting in a notification.
Note to self for debugging I used this in the browser:
await fetch('https://momentjs.com/downloads/moment.min.js')
.then(response => response.text())
.then(text => eval(text))
a = await fetch('https://minasidor.sectoralarm.se/Panel/GetPanelHistory/xxxxx')
b = await a.json()
c = b.LogDetails.map(a => ({...a, Time: moment(a.Time).format()}))
The text was updated successfully, but these errors were encountered:
Would be happy to have a look at it. Just to say first the api from Sector is not very nice and therefore as you already spotted you can and will get several timeouts. To collect all the data there is several requests and therefore you might get a timeout on one and next one is fine.
If you are not can you run the last beta available and see if it changes something for you. The problem with the incorrect state changes should be fixed.
Overview
Details / debugging
I've set up an automation to notify when the state changes and it fires constantly without any state changes. It works correctly when state does change, but through the day there can be 0-{n} extra updates due to nothing. This makes it impossible to use as a reliable indication of the alarm state change.
Automations
Auto enable at 21:00
Notify on state change
Logs
So added some debugs in the code and I see this when the rogue notification is sent:
Initial normal update
_alarmstatus
is constant, but watch_changed_by
Timeout error?
(why does it say "successful" if there was a timeout).
Rogue update triggered by the next request
I'm assuming something happened due to the last timeout but now the
_changed_by
has changed.Looking at the logs from
GetPanelHistory
endpoint the following is two latest events:Last night it was set partial armed by automation at 21:00, this morning disabled by
Annie
at 10:05. Yet all the logs show the user who last changed washome
(this is the user I set up for HA that did arm the system). Then somehow at 14:34 (~4 hours later) it gets the right user (Annie
) has changed resulting in a notification.Note to self for debugging I used this in the browser:
The text was updated successfully, but these errors were encountered: