dchesterton / texecom2mqtt-hassio

Home Assistant add-on. Connect to Texecom Premier Elite alarm panels and publish updates to MQTT. Supports arming/disarming as well as zone updates and alarm events.
https://hub.docker.com/r/dchesterton/texecom2mqtt
MIT License
52 stars 9 forks source link

Container won't start on Supervisor 2021.02.5 #10

Closed RogerSelwyn closed 3 years ago

RogerSelwyn commented 3 years ago

The texecom2mqtt add-on will no longer start. Only change made was to upgrade Supervisor to 2021-02-5 and reboot server.

The following error is shown in the Texecom2mqtt log:

(node:6) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'port' of undefined
    at setDefaults (/snapshot/app/dist/config.js:18:96)
    at Object.loadConfig (/snapshot/app/dist/config.js:65:16)
    at /snapshot/app/dist/index.js:18:29
    at Generator.next (<anonymous>)
    at /snapshot/app/dist/index.js:8:71
    at new Promise (<anonymous>)
    at /snapshot/app/dist/index.js:4:12
    at /snapshot/app/dist/index.js:17:8
    at Object.<anonymous> (/snapshot/app/dist/index.js:56:4)
    at Module._compile (pkg/prelude/bootstrap.js:1320:22)
(node:6) 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:6) [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.
The following errors are shown in my supervisor log:
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options texecom
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options mqtt
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options homeassistant
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options log
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options texecom
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options mqtt
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options homeassistant
21-02-08 12:28:55 WARNING (MainThread) [supervisor.addons.options] Unknown options log
21-02-08 12:28:56 INFO (SyncWorker_3) [supervisor.docker.addon] Starting Docker add-on dchesterton/texecom2mqtt with version None

Environment is as below:

System Health

version core-2021.2.1
installation_type Home Assistant Supervised
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.4.0-65-generic
arch x86_64
timezone Europe/London
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4958 Installed Version | 1.11.0 Stage | running Available Repositories | 710 Installed Repositories | 9
Home Assistant Supervisor host_os | Ubuntu 20.04.2 LTS -- | -- update_channel | stable supervisor_version | supervisor-2021.02.5 docker_version | 19.03.13 disk_total | 31.4 GB disk_used | 21.5 GB healthy | true supported | failed to load: Unsupported supervisor_api | ok version_api | ok installed_addons | Samba share (9.3.0), Node-RED (8.1.0), SSH & Web Terminal (8.0.0), File editor (5.2.0), Dropbox Sync (1.3.0), Mosquitto broker (5.1), AdGuard Home (3.0.0), Apache2 (1.7.2), MariaDB (2.2.1), OpenZWave (0.9.0), Nginx Proxy Manager (0.9.0), FTP (4.0.0), texecom2mqtt (latest), Ring Devices (4.3.0), Grafana (6.1.0)
Lovelace dashboards | 2 -- | -- resources | 5 views | 9 mode | storage
RogerSelwyn commented 3 years ago

One comment, I would have thought log would be 'int?' rather than 'str?'. Can it be something other than a number? And in fact it errors when I put the value as '2' (2 without quotes is shown as invalid config) within the texecom2mqtt log:

0, 1, 2, 3, 4, debug, error, info, panel, warning

RogerSelwyn commented 3 years ago

My full config is as below, if anyone needs another example:

texecom:
  host: 192.168.1.000
  udl_password: '9999'
mqtt:
  host: 'mqtt://core-mosquitto:1883'
  username: USERNAME
  password: PASSWORD
  client_id: texecom2mqtt
  keepalive: 30
  retain: true
homeassistant:
  discovery: true
areas:
  - id: house
    full_arm: armed_away
    part_arm_1: armed_home
zones:
  - id: inner_doors
    device_class: door
  - id: external_bell
    device_class: sound
RogerSelwyn commented 3 years ago

I spoke to soon, your schema is missing device_class: "str?", under zones key. I'll submit a PR.

    "zones": [
      {
        "id": "str?",
        "name": "str?"
      }
    ],
dchesterton commented 3 years ago

Thanks Roger, I've merged that PR. Hopefully that should fix it for some people who are getting an error (you may need to reload the repository). If you're still struggling with your config, please post it here and I'll see if I can help. As I say, the Home Assistant error message is quite unhelpful.

One comment, I would have thought log would be 'int?' rather than 'str?'. Can it be something other than a number? And in fact it errors when I put the value as '2' (2 without quotes is shown as invalid config) within the texecom2mqtt log.

The log option should now be one of debug, panel, info, warning or error. The numeric options are deprecated and unfortunately there's no way to do something like "str|int" in the schema.

RogerSelwyn commented 3 years ago

The log option should now be one of debug, panel, info, warning or error. The numeric options are deprecated and unfortunately there's no way to do something like "str|int" in the schema.

No problem. I don't really need any non-standard log, and I can change to one of the text values if needed.

ManicGTI commented 3 years ago

Legend, that update has me back up and running again! Thank you. As above I struggled with the validation (loads of errors and cursor jumping around), but got there in the end.

dchesterton commented 3 years ago

Glad to hear it 🙂 I noticed the cursor jumping around too when I was fixing it, seems to be a bug in HA.

I'm going to close this issue now as the problem seems to be fixed. If anyone is having issues still, feel free to reach out on the HA forum or create a new issue.