Mon Mar 26 2018 10:44:37 GMT+1100 (AEDT)
Error executing service <ServiceCall alarm_control_panel.alarm_disarm: code=>
Traceback (most recent call last):
File "/usr/src/app/homeassistant/core.py", line 1010, in _event_to_service_call
yield from service_handler.func(service_call)
File "/usr/src/app/homeassistant/components/alarm_control_panel/__init__.py", line 140, in async_alarm_service_handler
yield from getattr(alarm, method)(code)
File "/usr/local/lib/python3.6/asyncio/futures.py", line 327, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result
raise self._exception
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/alarm_control_panel/bwalarm.py", line 463, in alarm_disarm
if not self._validate_code(code, STATE_ALARM_DISARMED):
File "/config/custom_components/alarm_control_panel/bwalarm.py", line 604, in _validate_code
check = self._code is None or code == self._code or code in self._codes
AttributeError: 'BWAlarm' object has no attribute '_codes'
Could you go to line 604 in your bwalarm.py and change the line to:
check = self._code is None or code == self._code# or code in self._codes
basically comment out the last section? I think I know whats up with it, I was prepping the code for mutli user codes and that has sneaked into the latest release
Odd that I didnt get the same error though. I wonder if your alarm code is validating. Do you have your alarm code in single quotes in alarm.yaml?
I have just pushed a fix to bwalarm in the repo hopefully it resolves your issue
Yes, Alarm code is in single quotes. I have updated the bwalarm.py as you mentioned. Looks like it’s working as in I can disarm but still can’t see my sensors.
Could you post your alarm.yaml file without the codes?
Your time and weather sensors are missing too plus the full UI looks off. Which browser are you using and have you cleared the cache?
HI @gazoscalvertos,
Below is my alarm.yaml. I am using firefox (Ubuntu). I will try to clear cache and try again. I will update this post after cache clear.
PS: Cleared the cache and still same output. Looks like it stopped working again after I enabled MQTT section from alarm.yaml.
platform: bwalarm
name: House
alarm: automation.alarm_triggered
warning: automation.alarm_warning
code: '****' #Master Code, should consist of one or more digits ie '6482' ensure your passcode is encapsulated by quotes
panic_code: '****' #[OPTIONAL] Panic Code should consist of one or more digits ie '9876' ensure your passcode is encapsulated by quotes, it needs to be different to your standard alarm code. This enables a special panic mode. This can be used under duress to deactivate the alarm which would appear to the unseeing eye as deactivated however a special attribute [panic_mode] listed under the alarm_control_panel.[identifier] will change to ACTIVE. This status could be used in your automations to send a notification to someone else police/spouse/sibling/neighbour that you are under duress. To deactive this mode arm then disarm your alarm in the usual manner.
# codes: #[OPTIONAL, list of names/codes] User specific codes.
# - name: gazos
# code: '6576'
# - name: enzo
# code: '8734'
pending_time: 25 #[DEFAULT] Grace time in seconds to allow for exit and entry using Away mode
trigger_time: 300 #[DEFAULT] The amount of time the alarm stays triggered before returning to its previous state
armed_perimeter: #[OPTIONAL]
##[OPTIONAL however either an immediate or delayed group must exist] Sensors in this group tigger the alarm immediately
immediate:
- binary_sensor.study_sensor
armed_home: #[REQUIRED]
pending_time: 10
trigger_time: 300 #[OPTIONAL] State specific overrides default time above
##[OPTIONAL however either an immediate or delayed group must exist] Sensors in this group tigger the alarm immediately
immediate:
- binary_sensor.study_sensor
##[OPTIONAL] Sensors in this group start the clock (pending_time) when tripped before the alarm is triggered
delayed:
- binary_sensor.study_sensor
armed_away: #[REQUIRED]
trigger_time: 600 #[OPTIONAL] State specific overrides default time above
##[OPTIONAL however either an immediate or delayed group must exist] Sensors in this group tigger the alarm immediately
immediate:
- binary_sensor.study_sensor
##[OPTIONAL] Sensors in this group start the clock (pending_time) when tripped before the alarm is triggered
delayed:
- binary_sensor.study_sensor
#[OPTIONAL] Use this group to automatically override the warning message on open sensors when arming. (I use this as I have a motion sensor at the front door)
override:
- binary_sensor.study_sensor
##[INTERFACE OPTIONAL SETTINGS]
clock: True #[Optional] - False by default. True enables a clock in the center of the status bar
perimeter_mode: True #[Optional] - False by default. True enables perimeter mode, this could be known as 'Day Mode' i.e. only arm the doors whilst there is someone using all floors
weather: True #[Optional] - False by Default. Allows a weather summary to be displayed on the status bar. Dark Sky weather component must be enabled with the name sensor.dark_sky_summary
persistence: False #[OPTIONAL] False by Default. Allows this custom component to save the state of the alarm to file then reinstate it in the event of power loss.
hide_passcode: True #[OPTIONAL] - True by default. This is a security feature when enabled hides the passcode while entering disarm code.
hide_sidebar: False #[OPTIONAL] - False by default. This is a security feature when enabled hides the HA sidebar when the alarm is armed. The sidebar re-appears when the alarm is disarmed.
#hide_sensor_groups: True #[Optional] - False by default. Setting this to True hides sensor groups (all sensors, immediate sensors, delayed sensors, inactive sensors) from the display. Open sensors will still appear
hide_custom_panel: True #[Optional] - True by default. Setting this to False enables a custom panel below the sensors groups which allows you to add your own html code. Use this to bring any other features you would like to see for example displaying live camera feeds, a rotating image gallery, custom HA buttons and sensors. To use this enable the custom panel in alarm.yaml (custom_panel: True) then ensure you take a copy of custom-element.html and add it to you www/alarm/ folder. Edit the html code between the <template> tags. I'm have added a custom sample folder where I will upload examples of 'things' which can be added here. Please contribute!!!
##[PASSCODE RELATED]
#passcode_attempts: 3 #[Optional] Disabled if commented out. When a value equal or greater than 0 is set, the system will only allow the set amount of password attempts before timing out
#passcode_attempts_timeout: 30 #[Optional] Default 30 seconds. When set with the password attempts option the panel will timeout for the amount of seconds set if the password is entered incorrectly as per the password_attempts option. The system will then reset the allowed password attempts
##[MQTT RELATED]
#mqtt: True #[OPTIONAL] - False by default. Settings this to True will enable MQTT Mode. Uncomment options below to use See the README for guidance.
#override_code: True #[OPTIONAL] False by default. if true allows MQTT commands to disarm the alarm without a valid code.
#state_topic: 'home/alarm' #[OPTIONAL] The MQTT topic HA will publish state updates to.
#command_topic: 'home/alarm/set' #[OPTIONAL] The MQTT topic HA will subscribe to, to receive commands from a remote device to change the alarm state.
#qos: 0 #[OPTIONAL] The maximum QoS level for subscribing and publishing to MQTT messages. Default is 0.
#payload_disarm: "DISARM" #[OPTIONAL] The payload to disarm this Alarm Panel. Default is “DISARM”.
#payload_arm_home: "ARM_HOME" #[OPTIONAL] The payload to set armed-home mode on this Alarm Panel. Default is “ARM_HOME”.
#payload_arm_away: "ARM_AWAY" #[OPTIONAL] The payload to set armed-away mode on this Alarm Panel. Default is “ARM_AWAY”.
#payload_arm_night: "ARM_NIGHT" #[OPTIONAL] The payload to set armed-night mode on this Alarm Panel. Default is “ARM_NIGHT”.
## [COLOURS] Use any HTML format
warning_colour: 'orange'
pending_colour: 'orange'
disarmed_colour: '#03A9F4'
armed_home_colour: 'black'
armed_away_colour: 'black'
triggered_colour: 'red'
#############REMOVE#######################################
## [SENSOR GROUPS]
##Sensors in this group tigger the alarm immediately
# immediate:
# - binary_sensor.back_door
# - binary_sensor.kitchen_window
# ##Sensors in this group start the clock (pending_time) when tripped before the alarm is activated in 'Away' mode
# delayed:
# - binary_sensor.kitchen_motion
# - binary_sensor.hall_motion
# - binary_sensor.front_door
# - binary_sensor.garage_door
# ##Same as notathome but hopefully the title is more self explanatory. Can still use notathome for backwards compatibility
# ##Note sensors can exist in more than one group notice top_floor appears in two groups
# homemodeignore:
# - binary_sensor.hall_motion
# ##Use this group to automatically override the warning message on open sensors when setting 'away' mode. (I use this as I have a motion sensor at the front door)
# override:
# - binary_sensor.hall_motion
# - binary_sensor.front_door
# ##This group is special and only effects 'perimeter mode'. If perimeter_mode is enabled then any sensor in this group will trigger the alarm immediately if arm perimeter is set. There is no delayed group for this mode (unless requested as a feature of course!)
# perimeter:
# - binary_sensor.front_door
# - binary_sensor.back_door
# - binary_sensor.garage_door
###########################################################
## [CUSTOM SENSOR STATUSES]
## These settings allow devices which are not natively supported by this panel to be used.
## This is to be used when the state of the device is not recognised by the panel. Examples are provided below
#custom_supported_statuses_on:
# - 'running' #EXAMPLE
# - flipped #EXAMPLE
#custom_supported_statuses_off:
# - 'not_running' #EXAMPLE
# - unflipped #EXAMPLE
if you have one binary_sensor this can be put in either immediate or delay for each mode.
check the line and change to False
hide_sensor_groups: False
after you have change any config from home assistant.
- restart or reboot your ha is a must.
- clear all browsing history and cache from your browser that you used.
- open ha again.
are you using the mqtt alarm control panel or just only this custom component as alarm control panel?
this custom component is alarm control panel itself without needs of mqtt alarm and you can use either of them.
So if you don’t have mqtt alarm exist then just put # in front of mqtt section in alarm.yaml.
Also if possible show you alarm.yaml config so we can help.
Hi @Sunonline,
I have disabled the MQTT section and yes, I am planning to use it later. I have MQTT broker running on same machine.
I have posted my alarm.yaml in above post for @gazoscalvertos.
Thanks
If you already got the alarm control panel running but couldn’t see the sensor.
Try to open HA from google chrome browser which works best for HA, then see if everything load ok.
I’ll PM you
Maybe you can also create a hassio addon, then you can publish updates
I upgraded today. Thanks for all new features!
I see there’s an option for multiple codes now, that’s just great…
# codes: #[OPTIONAL, list of names/codes] User specific codes.
# - name: gazos
# code: '6576'
# - name: enzo
# code: '8734'
…but it’s not implemented yet I assume?
Very promising anyway. Will there even be possible to track which code/name was used to disarm?
Hi gazoscalvertos, does the MQTT still function?
When I set the mqtt: True, i cannot open the Alarm Panel
My log shows:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.6/asyncio/tasks.py”, line 180, in _step
result = coro.send(None)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 258, in _async_add_entity
await entity.async_added_to_hass()
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/config/custom_components/alarm_control_panel/bwalarm.py”, line 672, in async_added_to_hass
return self.mqtt.async_subscribe(
AttributeError: ‘NoneType’ object has no attribute ‘async_subscribe’
and:
https://my web site/frontend/panels/alarm-04cb8e8210cbe9d98093bb2898610b63.html:272:34 Uncaught TypeError: Cannot read property ‘attributes’ of undefined
I’m running Hass.io 0.65.6 on RPI3. It was working on the previous version of the Alarm.
Thanks!
Sorry folks there’s clearly an issue with MQTT I’ll work on a fix today. In the mean time you could too back to a previous version
install it 2 days ago works f in alsum
2 problem
NO clock
after reading the alarm.html I see what missing
FIX MUST HAVE sensor.time
and
tryed out the MQTT bit no go alarm panel did not display
yes I have MQTT working on all 10 of my Sonoff’s
will look into it tho
Thank for all the hard work you have done
think it took me longer to read this than intall it
did you put some sensors ??
immediate:
- sensor.Garage_Door
- sensor.Garage_Side_Door
in the alarm.yaml