Skip to content

How to arm/disarm with esphome ? #64

Answered by Dilbert66
chreggy asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, calling an internal function of a custom component is tricky because of the way esphome loads the components. You need to use a lambda function. You can look at the interval: section in the dscalarm.yaml for an example. I've cobbled up quickly what I think it should be in your example for the conditions. I have not tested it so it might need tweaking. I used the set_alarm_state command in this case. The function has 3 arguments.

1=alarm state which can be S=arm stay, A=armed away, N=armed night mode, D=disarm.
2=access code if needed by the command such as for disarm or night mode
3=partition to send the command to.

For the disarm access code below, I used the global variable set in …

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by chreggy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants