Only binary sensors are supported.
but it supported custom states in the old version, do you think itâs definitely gone now?
ÂŻ\_(ă)_/ÂŻ
Dunno.
Awesome alarm system! I have just one problem with it. I have an automation that turns the alarm off when I arrive home, but I keep getting an error of Invalid code. It still disarms the system, I have tried the code in the ui and it works fine.
- alias: Disarm the house when blah arrives home
trigger:
platform: state
entity_id: binary_sensor.blah_bayesian
from: "off"
to: "on"
action:
- service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.house
data:
code: 1234
DEBUG (SyncWorker_27) [custom_components.alarm_control_panel.bwalarm] [ALARM] Invalid code given 1234
DEBUG (SyncWorker_27) [custom_components.alarm_control_panel.bwalarm] [ALARM] Alarm changing from armed_away to disarmed
Can anyone see what I am doing wrong?
thanks
Do you mean that it disarms the alarm either way, but you get that Invalid code given
only when your automation triggers? And the code is actually right?
By the way, what version of alarm are you using? I cannot reproduce it on (see custom_components/alarm_control_panel/bwalarm.py)
VERSION: 1.1.3
MODIFIED: 13/11/18
I made a script with sequence as your action, and it works as expected - wrong code is reported, on right code it disarms.
Are you having log level of your alarm set as debug? Itâs not by defaultâŚ
From the alarm code I presume that not only binary sensors are allowed.
Have look at these attributes (case-insensitive) and try to change your code if necessary:
âsupported_statuses_onâ: [
âonâ,
âtrueâ,
âunlockedâ,
âopenâ,
âdetectedâ,
âmotionâ,
âmotion_detectedâ,
âmotion detectedâ
],
âsupported_statuses_offâ: [
âoffâ,
âfalseâ,
âlockedâ,
âclosedâ,
âundetectedâ,
âno_motionâ,
âstandbyâ
]
because of the alarm.html:
case âmessageâ:
switch (entry[2]){
case 0:
return âdisarmed the alarmâ;
break;
case 1:
return âDisarm attempt failed, wrong code!â;
break;
case 2:
return 'The alarm has been triggered! Sensor: ';
break;
case 3:
return âset the alarm in Home modeâ;
break;
case 4:
return âset the alarm in Away modeâ;
break;
case 5:
return 'Alarm has been tripped! Sensor: â ;
break;
case 6:
return âPanel Lockedâ;
break;
case 8:
return âset the alarm in Perimeter modeâ;
break;
The easiest way to get the sensorsâ names is to add + entry[3]
after those strings ending with Sensor:
like this
return 'Alarm has been tripped! Sensor: ' + entry[3];
and donât forget to clear cache/reload page in your browser.
That used to work (plain sensors with custom statuses) with version 1.0.2 and panel v1.1.2
Installing the latest github version with HA 0.86.4 broke it (or at least didnât work with the new front-end configurator)
Anyway, Iâll read past messages to try to see what can I do.
What are the recommended versions of this component?
Basically you need to backup your alarm.yaml, copy a new (almost empty) one from github alongside everything else, run configurator, exit and change alarm.yaml manually (itâs obvious when you look inside).
The latest version of this component (with some tweaks) works fine with my Hass.io 0.86.1
Thank you, Iâll give another try during the weekend
Thanks for the response @AhmadK . Sorry if I wasnât clear.
So its nothing to do with the automation. Trying a few more things before I replied to you I have discovered that it works fine for user 1 and gives this error on user 2⌠it still disarms the alarm system just gives an error. I have deleted the user and recreated it but its still the same.
With user 2 it even gives the error in the alarm control panel⌠but again still disarms it
Any chance to see your config to reproduce?
Currently I can see little point in different users apart from having per-user codes (what for?).
So I know who has disarmed the system.
Sure what config do you want to see? alarm.yaml?
How user 1 and user 2 disarm the alarm?
They will eventually disarm it by a Bayesian presence detection but this is giving the error with just entering it via the ui keypad
ok, so the automation does work, but their per-user codes donât when they enter it via UI?
If yes, do the codes in automation match per-user codes?
It would be great to see automation(s) and alarm.yaml
The codes always work its just the 2nd user ones gives that error in the logs but still unlocks the alarm.
I have to dash right now will post the automations and alarm.yaml in an hr or so
Thank you so much for your help, that worked a treat.
Just be picky, is there a way for it to display the Friendly Name rather than the Entity ID? Absolutely no worries if itâs not possible.
yes, there is a way as you can see on the screenshot above.
however, it requires plenty of small changes to bwalarm.py as well.
perhaps Iâll make a PR later.