mak-gitdev / HA_enoceanmqtt

Home Assistant wrapper for enocean-mqtt (https://github.com/embyt/enocean-mqtt)
GNU General Public License v3.0
54 stars 14 forks source link

EnOcean MQTT (dev) Addon on Home Assitant is immediately stopping after starting #134

Closed Dixi4 closed 5 months ago

Dixi4 commented 5 months ago

The problem

The EnOcean MQTT AddOn is used with Moskito Broker 6.4.0 on Raspberry PI 5. After Installation and configuration it starts and stops immediately after starting.

What type of installation are you running?

Addon

What version of HA_enoceanmqtt has the issue?

0.1.28-2

What was the last working version of HA_enoceanmqtt?

never run, new setup

What type of Home Assitant installation are you running?

Home Assistant OS

Anything in the logs that might be useful to solve the issue? (Strongly recommended if applicable)

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Preparing to start...
Retrieved devices file: /config/enoceanmqtt.devices.sample
Overwrite use_dev_name_in_entity to FALSE
Starting EnOceanMQTT...
/usr/lib/python3.11/html/parser.py:170: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument `features="xml"` into the BeautifulSoup constructor.
  k = self.parse_starttag(i)
2024-03-04 22:00:39,889 INFO: Logging to file: /config/enoceanmqtt.log
2024-03-04 22:00:39,889 INFO: Loading config file /data/enoceanmqtt.conf
Traceback (most recent call last):
  File "/app/venv/bin/enoceanmqtt", line 33, in <module>
    sys.exit(load_entry_point('enocean-mqtt', 'console_scripts', 'enoceanmqtt')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/enocean-mqtt/enoceanmqtt/enoceanmqtt.py", line 110, in main
    sensors, global_config = load_config_file(conf['config'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/enocean-mqtt/enoceanmqtt/enoceanmqtt.py", line 65, in load_config_file
    new_sens[key] = int(config_parser[section][key], 0)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 0: '<your_device_rorg>'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Additional information

Home Assistant Version

Version core-2024.2.5 Installationstyp Home Assistant OS Entwicklung false Supervisor true Docker true Benutzer root Virtuelle Umgebung false Python-Version 3.12.1 Betriebssystemfamilie Linux Betriebssystem-Version 6.1.73-haos-raspi CPU-Architektur aarch64 Zeitzone Europe/Berlin Konfigurationsverzeichnis /config

enoceanmqtt.devices.sample file [NodON_Sensor_01] address = 0x0** rorg = func = type =

[NodON_Sensor_02] address = 0x0*** rorg = func = type =

[NodON_Sensor_03] address = 0x0*** rorg = func = type =

[NodON_Sensor_04] address = 0x0*** rorg = func = type =

mak-gitdev commented 5 months ago

@Dixi4,

Could you indicate where is your device file located ?

Please have a look at this discussion.

Dixi4 commented 5 months ago

My file location was /config/enoceanmqtt.devices.sample

After reading the other thread I change the setting in the AddOn configuration as you suggest to /config/config/enoceanmqtt.devices

The errors are different now but the Addon is not starting.

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started Preparing to start... Retrieved devices file: /config/config/enoceanmqtt.devices Overwrite use_dev_name_in_entity to FALSE cat: can't open '/config/config/enoceanmqtt.devices': No such file or directory s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

Changing to /config/enoceanmqtt.devices (renamed the .sample file)

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started Preparing to start... Retrieved devices file: /config/enoceanmqtt.devices Overwrite use_dev_name_in_entity to FALSE Starting EnOceanMQTT... /usr/lib/python3.11/html/parser.py:170: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor. k = self.parse_starttag(i) 2024-03-05 18:16:37,892 INFO: Logging to file: /config/enoceanmqtt.log 2024-03-05 18:16:37,892 INFO: Loading config file /data/enoceanmqtt.conf Traceback (most recent call last): File "/app/venv/bin/enoceanmqtt", line 33, in sys.exit(load_entry_point('enocean-mqtt', 'console_scripts', 'enoceanmqtt')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/enocean-mqtt/enoceanmqtt/enoceanmqtt.py", line 110, in main sensors, global_config = load_config_file(conf['config']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/enocean-mqtt/enoceanmqtt/enoceanmqtt.py", line 65, in load_config_file new_sens[key] = int(config_parser[section][key], 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 0: '' s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

File "/app/venv/bin/enoceanmqtt", line 33, in Where should this folder/file be located? I cannot find a /app folder and also the /data folder contains only ssh stuff.

Dixi4 commented 5 months ago

Tried to find the "enoceanmqtt.conf" file but seems not to be there.

image

mak-gitdev commented 5 months ago

@Dixi4,

Sorry, missed some lines in your logs from your first message. /config/enoceanmqtt.devices is the correct one.

Your issue is because your device file contains invalid data. You must define valid address, rorg, func and type for each sensor.

Also enoceanmqtt is an addon, hence a docker container. You cannot have access to its internals from HA.

Dixi4 commented 5 months ago

I didn't know that the Addon is in a container as well. Ok, thank you for the explanation, this makes the behavior understandable. The addresses could I find in the logs, but not the other parameters.

But this brings me to my next issue, I don't know these values until now and didn't find them in NodON docu or on the Enocean portal. It is a NodOn Door/Window sensor EEP – D5-00-01.

From my logs: 2024-03-02 20:40:24.735 DEBUG (Thread-3) [homeassistant.components.enocean.dongle] Received radio packet: 05:90:22:F6->FF:FF:FF:FF (-85 dBm): 0x01 ['0xd5', '0x9', '0x5', '0x90', '0x22', '0xf6', '0x0'] ['0x0', '0xff', '0xff', '0xff', '0xff', '0x55', '0x0'] OrderedDict()

Any final tipp for me where get to these parameters? Thank you for your help!

Dixi4 commented 5 months ago

Now it looks better, after modifying the /config/enoceanmqtt.devices file. AddON is running now.

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started Preparing to start... Retrieved devices file: /config/enoceanmqtt.devices Overwrite use_dev_name_in_entity to FALSE Starting EnOceanMQTT... /usr/lib/python3.11/html/parser.py:170: XMLParsedAsHTMLWarning: It looks like you're parsing an XML document using an HTML parser. If this really is an HTML document (maybe it's XHTML?), you can ignore or filter this warning. If it's XML, you should know that using an XML parser will be more reliable. To parse this document as XML, make sure you have the lxml package installed, and pass the keyword argument features="xml" into the BeautifulSoup constructor. k = self.parse_starttag(i) 2024-03-06 19:21:28,758 INFO: Logging to file: /config/enoceanmqtt.log 2024-03-06 19:21:28,759 INFO: Loading config file /data/enoceanmqtt.conf 2024-03-06 19:21:28,760 DEBUG: Created sensor: {'name': 'enoceanmqtt/NodON_Sensor_01', 'address': 93278195, 'rorg': 213, 'func': 0, 'type': 1} 2024-03-06 19:21:28,760 DEBUG: Created sensor: {'name': 'enoceanmqtt/NodON_Sensor_02', 'address': 93332214, 'rorg': 213, 'func': 0, 'type': 1} 2024-03-06 19:21:28,761 DEBUG: Created sensor: {'name': 'enoceanmqtt/NodON_Sensor_03', 'address': 93278181, 'rorg': 213, 'func': 0, 'type': 1} 2024-03-06 19:21:28,761 DEBUG: Created sensor: {'name': 'enoceanmqtt/NodON_Sensor_04', 'address': 93815879, 'rorg': 213, 'func': 0, 'type': 1} 2024-03-06 19:21:28,761 DEBUG: Global config: {'enocean_port': '/dev/ttyUSB1', 'log_packets': 'false', 'overlay': 'HA', 'db_file': '/data/enoceanmqtt_db.json', 'mapping_file': '', 'ha_dev_name_in_entity': 'False', 'mqtt_discovery_prefix': 'homeassistant/', 'mqtt_host': 'core-mosquitto', 'mqtt_port': '1883', 'mqtt_client_id': 'enocean_gateway', 'mqtt_keepalive': '60', 'mqtt_prefix': 'enoceanmqtt/', 'mqtt_user': 'addons', 'mqtt_pwd': '*****', 'mqtt_debug': 'true'} 2024-03-06 19:21:28,832 INFO: Selected overlay : Home Assistant 2024-03-06 19:21:29,218 INFO: Mapping file correctly read: /app/enocean-mqtt/enoceanmqtt/overlays/homeassistant/mapping.yaml 2024-03-06 19:21:29,220 INFO: Device database /data/enoceanmqtt_db.json correctly read/created 2024-03-06 19:21:29,220 INFO: Authenticating: addons 2024-03-06 19:21:29,220 DEBUG: Connecting to host core-mosquitto, port 1883, keepalive 60 2024-03-06 19:21:29,222 INFO: SerialCommunicator started 2024-03-06 19:21:29,222 INFO: Auto Teach-in is disabled 2024-03-06 19:21:29,222 WARNING: Replacing Packet.optional with default value. 2024-03-06 19:21:29,227 DEBUG: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'enocean_gateway' 2024-03-06 19:21:29,323 INFO: Sending packet 2024-03-06 19:21:29,323 DEBUG: 0x05 ['0x8'] [] OrderedDict() 2024-03-06 19:21:29,423 DEBUG: 0x02 ['0x0', '0xff', '0xa6', '0xda', '0x80'] ['0xa'] OrderedDict() 2024-03-06 19:21:29,424 INFO: got response packet: OK 2024-03-06 19:21:29,428 DEBUG: Received CONNACK (0, 0) 2024-03-06 19:21:29,440 INFO: Succesfully connected to MQTT broker. 2024-03-06 19:21:29,441 DEBUG: Sending SUBSCRIBE (d0, m1) [(b'enoceanmqtt/NodON_Sensor_01/req/#', 0)] 2024-03-06 19:21:29,441 DEBUG: Sending SUBSCRIBE (d0, m2) [(b'enoceanmqtt/NodON_Sensor_02/req/#', 0)] 2024-03-06 19:21:29,442 DEBUG: Sending SUBSCRIBE (d0, m3) [(b'enoceanmqtt/NodON_Sensor_03/req/#', 0)] 2024-03-06 19:21:29,442 DEBUG: Sending SUBSCRIBE (d0, m4) [(b'enoceanmqtt/NodON_Sensor_04/req/#', 0)] 2024-03-06 19:21:29,443 DEBUG: Sending PUBLISH (d0, q0, r1, m5), 'b'homeassistant/binary_sensor/enocean_D50001_058F4FF3_NONE_contact/config'', ... (425 bytes) 2024-03-06 19:21:29,443 DEBUG: Sending PUBLISH (d0, q0, r1, m6), 'b'homeassistant/sensor/enocean_D50001_058F4FF3_NONE_rssi/config'', ... (482 bytes) 2024-03-06 19:21:29,443 DEBUG: Sending PUBLISH (d0, q0, r1, m7), 'b'homeassistant/sensor/enocean_D50001_058F4FF3_NONE_last_seen/config'', ... (522 bytes) 2024-03-06 19:21:29,443 DEBUG: Sending SUBSCRIBE (d0, m8) [(b'homeassistant/binary_sensor/enocean_D50001_058F4FF3_NONE_contact/config/#', 0)] 2024-03-06 19:21:29,444 DEBUG: Sending SUBSCRIBE (d0, m9) [(b'enoceanmqtt/NodON_Sensor_01/system/#', 0)] 2024-03-06 19:21:29,452 INFO: Device enoceanmqtt/NodON_Sensor_01 (UID: D50001_058F4FF3_NONE / EEP: D5-00-01) updated on device database 2024-03-06 19:21:29,453 DEBUG: Sending PUBLISH (d0, q0, r1, m10), 'b'homeassistant/binary_sensor/enocean_D50001_059022F6_NONE_contact/config'', ... (425 bytes) 2024-03-06 19:21:29,454 DEBUG: Sending PUBLISH (d0, q0, r1, m11), 'b'homeassistant/sensor/enocean_D50001_059022F6_NONE_rssi/config'', ... (482 bytes) 2024-03-06 19:21:29,455 DEBUG: Sending PUBLISH (d0, q0, r1, m12), 'b'homeassistant/sensor/enocean_D50001_059022F6_NONE_last_seen/config'', ... (522 bytes) 2024-03-06 19:21:29,455 DEBUG: Sending SUBSCRIBE (d0, m13) [(b'homeassistant/binary_sensor/enocean_D50001_059022F6_NONE_contact/config/#', 0)] 2024-03-06 19:21:29,455 DEBUG: Sending SUBSCRIBE (d0, m14) [(b'enoceanmqtt/NodON_Sensor_02/__system/#', 0)] 2024-03-06 19:21:29,465 INFO: Device enoceanmqtt/NodON_Sensor_02 (UID: D50001_059022F6_NONE / EEP: D5-00-01) updated on device database 2024-03-06 19:21:29,465 DEBUG: Sending PUBLISH (d0, q0, r1, m15), 'b'homeassistant/binary_sensor/enocean_D50001_058F4FE5_NONE_contact/config'', ... (425 bytes) 2024-03-06 19:21:29,466 DEBUG: Sending PUBLISH (d0, q0, r1, m16), 'b'homeassistant/sensor/enocean_D50001_058F4FE5_NONE_rssi/config'', ... (482 bytes) 2024-03-06 19:21:29,466 DEBUG: Sending PUBLISH (d0, q0, r1, m17), 'b'homeassistant/sensor/enocean_D50001_058F4FE5_NONE_last_seen/config'', ... (522 bytes) 2024-03-06 19:21:29,467 DEBUG: Sending SUBSCRIBE (d0, m18) [(b'homeassistant/binary_sensor/enocean_D50001_058F4FE5_NONE_contact/config/#', 0)] 2024-03-06 19:21:29,467 DEBUG: Sending SUBSCRIBE (d0, m19) [(b'enoceanmqtt/NodON_Sensor_03/system/#', 0)] 2024-03-06 19:21:29,471 INFO: Device enoceanmqtt/NodON_Sensor_03 (UID: D50001_058F4FE5_NONE / EEP: D5-00-01) updated on device database 2024-03-06 19:21:29,472 DEBUG: Sending PUBLISH (d0, q0, r1, m20), 'b'homeassistant/binary_sensor/enocean_D50001_05978447_NONE_contact/config'', ... (425 bytes) 2024-03-06 19:21:29,472 DEBUG: Sending PUBLISH (d0, q0, r1, m21), 'b'homeassistant/sensor/enocean_D50001_05978447_NONE_rssi/config'', ... (482 bytes) 2024-03-06 19:21:29,473 DEBUG: Sending PUBLISH (d0, q0, r1, m22), 'b'homeassistant/sensor/enocean_D50001_05978447_NONE_last_seen/config'', ... (522 bytes) 2024-03-06 19:21:29,473 DEBUG: Sending SUBSCRIBE (d0, m23) [(b'homeassistant/binary_sensor/enocean_D50001_05978447_NONE_contact/config/#', 0)] 2024-03-06 19:21:29,473 DEBUG: Sending SUBSCRIBE (d0, m24) [(b'enoceanmqtt/NodON_Sensor_04/system/#', 0)] 2024-03-06 19:21:29,481 INFO: Device enoceanmqtt/NodON_Sensor_04 (UID: D50001_05978447_NONE / EEP: D5-00-01) updated on device database 2024-03-06 19:21:29,481 DEBUG: List of remaining UIDS: [] 2024-03-06 19:21:29,481 DEBUG: Sending PUBLISH (d0, q0, r1, m25), 'b'homeassistant/switch/enoceanmqtt_learn_FFA6DA80/config'', ... (374 bytes) 2024-03-06 19:21:29,482 DEBUG: Sending SUBSCRIBE (d0, m26) [(b'enoceanmqtt/system/learn/req/#', 0)] 2024-03-06 19:21:29,482 DEBUG: Sending PUBLISH (d0, q0, r1, m27), 'b'enoceanmqtt/__system/learn'', ... (3 bytes) 2024-03-06 19:21:29,483 DEBUG: Received SUBACK 2024-03-06 19:21:29,483 DEBUG: Received SUBACK 2024-03-06 19:21:29,490 DEBUG: Received SUBACK 2024-03-06 19:21:29,491 DEBUG: Received SUBACK 2024-03-06 19:21:29,491 DEBUG: Received SUBACK 2024-03-06 19:21:29,491 DEBUG: Received PUBLISH (d0, q0, r1, m0), 'homeassistant/binary_sensor/enocean_D50001_058F4FF3_NONE_contact/config', ... (425 bytes) 2024-03-06 19:21:29,492 DEBUG: Received SUBACK 2024-03-06 19:21:29,492 DEBUG: Received SUBACK 2024-03-06 19:21:29,492 DEBUG: Received PUBLISH (d0, q0, r1, m0), 'homeassistant/binary_sensor/enocean_D50001_059022F6_NONE_contact/config', ... (425 bytes) 2024-03-06 19:21:29,492 DEBUG: Received SUBACK 2024-03-06 19:21:29,492 DEBUG: Received SUBACK 2024-03-06 19:21:29,493 DEBUG: Received PUBLISH (d0, q0, r1, m0), 'homeassistant/binary_sensor/enocean_D50001_058F4FE5_NONE_contact/config', ... (425 bytes) 2024-03-06 19:21:29,533 DEBUG: Received SUBACK 2024-03-06 19:21:29,533 DEBUG: Received SUBACK 2024-03-06 19:21:29,533 DEBUG: Received PUBLISH (d0, q0, r1, m0), 'homeassistant/binary_sensor/enocean_D50001_05978447_NONE_contact/config', ... (425 bytes) 2024-03-06 19:21:29,533 DEBUG: Received SUBACK 2024-03-06 19:21:29,534 DEBUG: Received SUBACK 2024-03-06 19:22:29,597 DEBUG: Sending PINGREQ 2024-03-06 19:22:29,598 DEBUG: Received PINGRESP 2024-03-06 19:23:29,661 DEBUG: Sending PINGREQ 2024-03-06 19:23:29,662 DEBUG: Received PINGRESP 2024-03-06 19:24:29,724 DEBUG: Sending PINGREQ 2024-03-06 19:24:29,725 DEBUG: Received PINGRESP

Dixi4 commented 5 months ago

After entering the correct parameters for the sensors in /config/enoceanmqtt.devices all NodOn sensors are showing up now and are working. Thank you for the kind support!!