fmartinou / tydom2mqtt

Deltadore Tydom to MQTT Bridge
https://fmartinou.github.io/tydom2mqtt/
MIT License
86 stars 49 forks source link

Alarm status unknown after upgrade from 2.6 to 3.0 #86

Closed FROCHE38 closed 1 year ago

FROCHE38 commented 1 year ago

Alarm ON/OFF is working but all status are KO image

Find some log of the mqtt:

2023-03-25 09:47:42,096 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 09:47:42,097 - sensors.Alarm        - ERROR   - Alarm sensors Error :
2023-03-25 09:47:42,097 - sensors.Alarm        - ERROR   - 'module' object is not callable
2023-03-25 09:47:42,098 - sensors.Alarm        - INFO    - Alarm created / updated : Tyxal Alarm 0_0 disarmed
2023-03-25 09:47:43,123 - tydom.MessageHandler - INFO    - Device configured (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 09:50:30,149 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 10:02:44,483 - mqtt.MqttClient      - INFO    - set_alarm_state message received (topic=alarm_control_panel/tydom/0_0/set_alarm_state, message=ARM_AWAY)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/app/main.py", line 119, in <module>
    main()
  File "/app/main.py", line 115, in main
    loop.run_forever()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once
    handle._run()
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/app/main.py", line 54, in listen_tydom
    await message_handler.incoming_triage()
  File "/app/tydom/MessageHandler.py", line 236, in incoming_triage
    await self.parse_response(incoming)
  File "/app/tydom/MessageHandler.py", line 298, in parse_response
    logger.warning('Unknown message type received', data)
Message: 'Unknown message type received'
Arguments: ('3046',)
2023-03-25 10:02:45,046 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 10:02:45,047 - sensors.Alarm        - ERROR   - Alarm sensors Error :
2023-03-25 10:02:45,048 - sensors.Alarm        - ERROR   - 'module' object is not callable
2023-03-25 10:02:45,049 - sensors.Alarm        - INFO    - Alarm created / updated : Tyxal Alarm 0_0 armed_away
2023-03-25 10:02:47,499 - tydom.MessageHandler - INFO    - Device configured (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 10:10:50,299 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 11:12:18,712 - mqtt.MqttClient      - INFO    - set_alarm_state message received (topic=alarm_control_panel/tydom/0_0/set_alarm_state, message=DISARM)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/app/main.py", line 119, in <module>
    main()
  File "/app/main.py", line 115, in main
    loop.run_forever()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once
    handle._run()
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/app/main.py", line 54, in listen_tydom
    await message_handler.incoming_triage()
  File "/app/tydom/MessageHandler.py", line 236, in incoming_triage
    await self.parse_response(incoming)
  File "/app/tydom/MessageHandler.py", line 298, in parse_response
    logger.warning('Unknown message type received', data)
Message: 'Unknown message type received'
Arguments: ('3046',)
2023-03-25 11:12:19,155 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 11:12:19,157 - sensors.Alarm        - ERROR   - Alarm sensors Error :
2023-03-25 11:12:19,158 - sensors.Alarm        - ERROR   - 'module' object is not callable
2023-03-25 11:12:19,159 - sensors.Alarm        - INFO    - Alarm created / updated : Tyxal Alarm 0_0 disarmed
2023-03-25 11:12:19,737 - tydom.MessageHandler - INFO    - Device configured (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 11:27:51,318 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
2023-03-25 11:40:31,460 - tydom.MessageHandler - INFO    - Device update (id=0, endpoint=0, name=Tyxal Alarm, type=alarm)
fmartinou commented 1 year ago

Hi,

Thanks for reporting this issue.

Can you first upgrade to 3.0.1 then update your issue with the log from 3.0.1 please? Thank you.

FROCHE38 commented 1 year ago

Hello, Super réactif :-) La version 3.0.1 corrige effectivement le problème. Un grand merci pour cet add-ons très précieux

fmartinou commented 1 year ago

Great! ☺️

Even if everything is working back, do you still get in your logs the stacktrace you posted above?

2023-03-25 11:12:18,712 - mqtt.MqttClient      - INFO    - set_alarm_state message received (topic=alarm_control_panel/tydom/0_0/set_alarm_state, message=DISARM)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
FROCHE38 commented 1 year ago

Hi, no error in the log now! Only INFO For me the bug I declare is now closed. Thanks again