ThermIQ / thermiq_mqtt-ha

Home Assistant integration of ThermIQ-MQTT, providing control and logging of Thermia heatpumps
https://thermiq.net
MIT License
22 stars 19 forks source link

Crashes on init, KeyError 'time' #31

Closed Maaxion closed 2 years ago

Maaxion commented 2 years ago

HomeAssistant Core version: core-2022.3.1 Home assistant supervisor version: supervisor-2022.01.1 ThermiQ-mqtt version: 2.05 thermiq_mqtt-ha version: v1.3.4

I seem to be using Verson 2.05 of ThermIQ-mqtt which in the MQTT mesage has the key Time with capital T instead of lowercase. this causes it to fail partway through init.

Altering line 366 in init.py to to uppercase Time seems to fix this.

Error message found in logs:

2022-03-06 12:44:50 ERROR (MainThread) [homeassistant.util.logging] Exception in message_received when handling msg on 'ThermIQ/ThermIQ-mqtt/data': '{"Client_Name":"ThermIQ_2462ABE543D0","app_info":"ThermIQ-mqtt 2.05","reason":"T","r00":3,"r01":20,"r02":0,"r03":20,"r04":0,"r05":32,"r06":27,"r07":51,"r08":-2,"r09":2,"r0a":-40,"r0b":0,"r0c":0,"r0d":0,"r0e":27,"r0f":37,"r10":7,"r11":0,"r12":0,"r13":0,"r14":16,"r15":0,"r16":128,"r17":61,"r18":0,"r19":-50,"r1a":0,"r1b":0,"r1c":0,"r1d":140,"r1e":0,"r1f":0,"r20":0,"r21":0,"r22":0,"r23":0,"r24":0,"r25":0,"r26":0,"r27":0,"r28":0,"r29":0,"r2a":0,"r2b":0,"r2c":0,"r2d":0,"r2e":0,"r2f":0,"r30":0,"r31":0,"r32":20,"r33":1,"r34":28,"r35":20,"r36":45,"r37":0,"r38":0,"r39":0,"r3a":17,"r3b":1,"r3c":0,"r3d":40,"r3e":10,"r3f":55,"r40":20,"r41":2,"r42":20,"r43":135,"r44":38,"r45":40,"r46":5,"r47":7,"r48":60,"r49":150,"r4a":10,"r4b":55,"r4c":20,"r4d":-15,"r4e":18,"r4f":80,"r50":20,"r51":3,"r52":20,"r53":60,"r54":55,"r55":0,"r56":0,"r57":0,"r58":0,"r59":0,"r5a":0,"r5b":0,"r5c":0,"r5d":0,"r5e":0,"r5f":0,"r60":0,"r61":0,"r62":1,"r63":1,"r64":3,"r65":3,"r66":1,"r67":1,"r68":24443,"r69":30303,"r6a":630,"r6b":20482,"r6c":2896,"r6d":11,"r6e":0,"r6f":0,"r70":0,"r71":-31744,"r72":132,"r73":0,"r74":0,"r75":0,"r76":0,"r77":0,"r78":0,"r79":0,"r7a":0,"r7b":0,"r7c":0,"r7d":2,"r7e":2,"r7f":2,"Time": "2022-03-06 11:44:50 CET","timestamp": 1646563490 }'
Traceback (most recent call last):
File "/config/custom_components/thermiq_mqtt/__init__.py", line 366, in message_received
hass.states.async_set(DOMAIN+".time_str", json_dict["time"])
KeyError: 'time'

Secondly, I have the following error, too.

2022-03-06 12:49:07 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall input_number.set_value (c:90ab172a61751169c699d3274ac49c14): value=3.0, entity_id=['input_number.thermiq_mqtt_elect_boiler_steps_max']>

This is fixed if I edit the range in thermiq_regs.py

After this I end up with around 20 or so of the following log lines 2022-03-06 12:56:20 WARNING (MainThread) [homeassistant.components.automation.thermiq_input_numbers_to_mqtt_thermiq_mqtt] ThermIQ Input numbers to MQTT [thermiq_mqtt]: Already running

As well as these warnings

2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_indoor_requested_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_curve_slope
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_curve_min
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_curve_max
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_curve_p5
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_curve_0
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_curve_n5
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_heating_stop_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_reduction_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_room_factor
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_curve_slope
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_curve_min
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_curve_max
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_curve_target
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_curve_actual
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_outdoor_stop_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_pressure_pipe_limit_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_hotwater_start_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_hotwater_runtime_m
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_heatpump_runtime_m
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_legionella_interval_d
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_legionella_stop_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_a_limit
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral1_hysteresis_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_returnline_max_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_start_interval_min_m
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_brine_min_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_cooling_target_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_a_limit
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_integral2_hysteresis_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_elect_boiler_steps_max
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_current_consumption_max_a
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_shunt_time_s
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_hotwater_stop_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_language
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_outdoor_sensor_offset_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_supplyline_sensor_offset_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_returnline_sensor_offset_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_boiler_sensor_offset_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_brine_in_sensor_offset_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_brine_out_sensor_offset_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_heatingsystem_type
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_internal_logging_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_brine_runout_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_brine_run_in_t
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_legionella_run_on
2022-03-06 12:56:06 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.thermiq_mqtt_legionella_run_length_h

I am wondering if the firmware on my ThermiQ-mqtt stick is old?

Maaxion commented 2 years ago

This discussion seems related.

https://community.home-assistant.io/t/thermiq-integration-to-control-thermia-and-danfoss-heatpumps/199262/33

Is this the correct procedure to update the firmware on the Thermiq-MQTT?

https://www.thermiq.net/en/hw/fw/

ThermIQ commented 2 years ago

No, that it's not the correct HW. Please download instructions for updating fw here: http://thermiq.net/ThermIQ_MQTT_Installation.pdf

ThermIQ commented 2 years ago

Fixed in v1.3.5