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

Get the current alarm state from --details output #20

Open
RosiersRobin opened this issue Jul 26, 2022 · 6 comments
Open

Get the current alarm state from --details output #20

RosiersRobin opened this issue Jul 26, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@RosiersRobin
Copy link

Question

I was wondering on how I could get the current state of the alarm, like Armed, away or stay. I can't seem to find anything related to the current state of the alarm?

@RosiersRobin RosiersRobin added the question Further information is requested label Jul 26, 2022
@caronc
Copy link
Owner

caronc commented Jul 26, 2022

If you're set up with your alarm panel, then just:

# Dump alarm panel status 
ultrasync --details

Or, a live feed will be more like:

# Dump alarm panel status 
ultrasync --watch

@RosiersRobin
Copy link
Author

But that gives you all the zones. I would like to get just the main state of the alarm

like here;

https://static.interlogix.com/images/ultrasync-for-dealers/overview.png

So what state -> Arm Away, Arm Stay Disarmed. There currently is no option for that, right?

@caronc
Copy link
Owner

caronc commented Jul 26, 2022

It's in the response, but yeah, you'd need to filter it out. You could use a tool such as jq to do it for example.

ultrasync --details | jq <your filters here>

@RosiersRobin
Copy link
Author

I've looked into the code, but I don't quit understand how you determine the current alarm state. (trying to implement this in PHP)

@caronc
Copy link
Owner

caronc commented Jul 27, 2022

I reviewed the code just now. You're right, there isn't a whole lot of detail in the result set since it's just the bank status that is being printed. I thought for some reason that i made it so it would print more details.

It doesn't really look like there is an option to get exactly what you want at this time. We can leave this ticket open and enhance the details output

@caronc caronc added enhancement New feature or request and removed question Further information is requested labels Jul 27, 2022
@caronc caronc changed the title How to get the current alarm state? Get the current alarm state from --details output Jul 27, 2022
@RosiersRobin
Copy link
Author

If it could be narrowed down to just like "status", that would be awesome.

image

I did dig in the source, trying to replicate the build for just one area, to get the status, but I don't seem to get it going. Especially struggeling with the following parts;

bank_state': bank_states[math.floor(x / 8) * 17:
                                          (math.floor(x / 8) * 17) + 17]

found in

'bank_state': bank_states[math.floor(x / 8) * 17:

and

vbank = [int(area['bank_state'][s:s + 2], 16) & mask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants