Misalignment of configuration vairables
Closed this issue · 1 comments
I am new to this addon, however I think there may be an issue with the config vairables. It could be that I am doing something wrong so feel free to point this out.
In the documentation it states that to map an area you have to use the following config...
areas:
- id: house # Required: area number or ID (e.g. 'detached_garage', '4A' or '2')
name: House Alarm # Optional: override the area name (default: area name in panel)
full_arm: armed_away # Optional: mappings of Texecom arm types to Home Assistant arm types (armed_away, armed_home, armed_night, armed_custom_bypass), omit any which are not relevant
part_arm_1: armed_night
part_arm_2: armed_home
part_arm_3: armed_custom_bypass
code_arm_required: false # Optional: see https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/#code_arm_required
code_disarm_required: false # Optional: see https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/#code_disarm_required
code: "123456" # Optional: see https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/#code
- id: ...
name: ...
Notice that the config vairables for the area mapping are named "part_arm_1" ect, however when I use this config the addon fails to start reporting several type match errors.
This is the config that fails (the 2 configs have different names for the part arm, I notice I had spaces without quotes so tried several different ways):
areas:
- id: A
name: House Alarm
full_arm: full
part_arm_1: bed
part_arm_2: ho
part_arm_3: go
zones: []
log: debug
Producing this error:
(node:8) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'match' of undefined
at /snapshot/app/node_modules/better-ajv-errors/lib/modern/helpers.js:26:53
at Array.forEach (<anonymous>)
at makeTree (/snapshot/app/node_modules/better-ajv-errors/lib/modern/helpers.js:21:13)
at _default (/snapshot/app/node_modules/better-ajv-errors/lib/modern/helpers.js:116:16)
at _default (/snapshot/app/node_modules/better-ajv-errors/lib/modern/index.js:27:45)
at validate (/snapshot/app/dist/config.js:58:24)
at Object.loadConfig (/snapshot/app/dist/config.js:45:16)
at /snapshot/app/dist/index.js:11:29
at Object.<anonymous> (/snapshot/app/dist/index.js:74:3)
at Module._compile (pkg/prelude/bootstrap.js:1433:22)
(node:8) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I then changed the config to the following and the addon starts with no errors...
areas:
- id: A
name: House Alarm
full_armed: Fully Armed
part_armed_1: Bedtime
part_armed_2: House Only
part_armed_3: Garage Only
In the logs it seems that sometimes this is referred to as part_arm and sometimes part_armed, hence why I tried it. I am unsure whether this is correct or if something has changed since the documentation was written. It could be the case that it is working because it isn't expecting to see "armed" instead of "arm"?
I need to map the areas as I am trying to trigger an event based on this but when I do, I get the following error and the automation does not trigger, I get this error with the area mapping completely removed from the config, or with the "armed" version of the config. With the documented config values I cannot get the addon to start.
2021-10-05 14:36:39 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'part_armed_1' when rendering '{% set values = {"in_entry":"pending","in_exit":"pending","disarmed":"disarmed","triggered":"triggered"} %}{{ values[value_json.status] }}'
2021-10-05 14:36:39 WARNING (MainThread) [homeassistant.components.mqtt.alarm_control_panel] Received unexpected payload: {"id":"A","name":"House Alarm","number":1,"status":"part_armed_1"}
Please note that I get the above error message with or without the areas mapped in the config, obviously I cannot produce this error message with the config wrote as stated in the documentation as the addon fails to start.
UPDATE
Okay most of what I've said can clearly be ignored, the correct value I assume is "part_arm_1" not "part_armed_1", I kept seeing armed instead of arm in the logs so made an assumption, however any value will be accepted in the config except for "part_arm_1", "part_arm_2" or "part_arm_3".
This does still mean that I cannot map the part arms though, it just throws the type match error as stated above.
*** UPDATE 14/10/2021 ***
Okay, I've got the areas mapped. I misunderstood that you have to use the Home Assistant options of "armed_home", "armed_away".
So I suppose my new question (I'm now realising this is still under "issues", but this may still be helpful to others too. Is there a variable I'm missing in Home Assistant to remap the naming of the part arms in the built in alarm system, my Texecom Premier Elite is set with 3 part arms that do no match home/away/custom_bypass, I'd like to be able to replicate this in HA.
Unfortunately there is no way to do this with HA as it doesn't support custom arming modes. The only "modes" that HA supports are home/night/away/custom_bypass so you have to map your Texecom part arms to one of them.