Hej.
Jag har ett problem med att integrationen med Home Assistant över MQTT inte riktigt verkar fungera.
Det är så att det kommer attribut som inte känns igen och det fyller loggen med rader.
Detta i sin tur innebär att jag måste rensa loggarna och starta om servern för att den skall fungera med jämna mellanrum.
Logger: homeassistant.helpers.template
Source: helpers/template.py:2209
First occurred: October 25, 2023 at 11:09:00 (126068 occurrences)
Last logged: 11:07:45
Template variable warning: ‘dict object’ has no attribute ‘csL3’ when rendering ‘{{value_json.csL3}}’
Template variable warning: ‘dict object’ has no attribute ‘csL2’ when rendering ‘{{value_json.csL2}}’
Template variable warning: ‘dict object’ has no attribute ‘csL1’ when rendering ‘{{value_json.csL1}}’
Template variable warning: ‘dict object’ has no attribute ‘bW’ when rendering ‘{{value_json.bW}}’
Template variable warning: ‘dict object’ has no attribute ‘bWh’ when rendering ‘{{value_json.bWh}}’
Som det verkar så är så att dessa värden är konfigurerade som sensorer men inte kommer med i själva statusmeddelandet och då säger Home Assistant till, detta är en feature som kommer att generera fel så småningom om jag förstår saker rätt.
Nedan har jag inkluderat loggar från MQTT integrationen med kommentarer, vill gärna få detta löst då det börjar bli problematiskt med alla omstarter.
Typiskt statusmeddelande
{“m”:“HAN”,“t”:“2023-10-26T10:24:15+0100”,“W”:3010,“Wh”:36934916,“Ph”:4,“Rh”:6215767,“Qh”:2983327,“P”:0,“R”:1416,“Q”:0,“L1”:821,“P1”:0,“R1”:494,“Q1”:0,“I1”:4.100,“U1”:231.800,“L2”:1140,“P2”:0,“R2”:580,“Q2”:0,“I2”:5.500,“U2”:230.600,“L3”:1047,“P3”:0,“R3”:342,“Q3”:0,“I3”:4.800,“U3”:230.100,“sec”:1698312258,“dW”:-16}
Exempel på konfiguration som skickas:
Message 159 received on homeassistant/sensor/csL1_0cbf1e79cf58/config at 11:43:
{
“uniq_id”: “csL1_0cbf1e79cf58”,
“obj_id”: “csL1_0cbf1e79cf58”,
“name”: “Currently ChangeScore L1”,
“dev_cla”: “power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “kW”,
“val_tpl”: “{{value_json.csL1}}”
}
QoS: 0 - Retain: true
Message 158 received on homeassistant/sensor/csL2_0cbf1e79cf58/config at 11:43:
{
“uniq_id”: “csL2_0cbf1e79cf58”,
“obj_id”: “csL2_0cbf1e79cf58”,
“name”: “Currently ChangeScore L2”,
“dev_cla”: “power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “kW”,
“val_tpl”: “{{value_json.csL2}}”
}
QoS: 0 - Retain: true
Message 157 received on homeassistant/sensor/csL3_0cbf1e79cf58/config at 11:43:
{
“uniq_id”: “csL3_0cbf1e79cf58”,
“obj_id”: “csL3_0cbf1e79cf58”,
“name”: “Currently ChangeScore L3”,
“dev_cla”: “power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “kW”,
“val_tpl”: “{{value_json.csL3}}”
}
Message 161 received on homeassistant/sensor/bWh_0cbf1e79cf58/config at 11:43:
{
“uniq_id”: “bWh_0cbf1e79cf58”,
“obj_id”: “bWh_0cbf1e79cf58”,
“name”: “Currently imps”,
“dev_cla”: “energy”,
“stat_cla”: “total_increasing”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “Wh”,
“val_tpl”: “{{value_json.bWh}}”
}
QoS: 0 - Retain: true
Message 160 received on homeassistant/sensor/blink_0cbf1e79cf58/config at 11:43:
{
“uniq_id”: “blink_0cbf1e79cf58”,
“obj_id”: “blink_0cbf1e79cf58”,
“name”: “Currently Blink Power”,
“dev_cla”: “power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “W”,
“val_tpl”: “{{value_json.bW}}”
}
Denna konfiguration verkar inte generera någon varning men då är å andra sidan I2 med i statusmeddelandet.
Message 23 received on homeassistant/sensor/I2_0cbf1e79cf58/config at 11:51:
{
“uniq_id”: “I2_0cbf1e79cf58”,
“obj_id”: “I2_0cbf1e79cf58”,
“name”: “Currently I2”,
“dev_cla”: “current”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “A”,
“val_tpl”: “{{value_json.I2}}”
}
För att förvirra saker ytterligare verkar det som dessa konfigurationer inte genererar någon varning (vad jag kan se):
Message 44 received on homeassistant/sensor/csR_0cbf1e79cf58/config at 11:51:
{
“uniq_id”: “csR_0cbf1e79cf58”,
“obj_id”: “csR_0cbf1e79cf58”,
“name”: “Currently ChangeScore R”,
“dev_cla”: “reactive_power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “var”,
“val_tpl”: “{{value_json.csR}}”
}
QoS: 0 - Retain: true
Message 43 received on homeassistant/sensor/csBLINK_0cbf1e79cf58/config at 11:51:
{
“uniq_id”: “csBLINK_0cbf1e79cf58”,
“obj_id”: “csBLINK_0cbf1e79cf58”,
“name”: “Currently ChangeScore BLINK”,
“dev_cla”: “power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “kW”,
“val_tpl”: “{{value_json.csBLINK}}”
}
QoS: 0 - Retain: true
Message 42 received on homeassistant/sensor/csW_0cbf1e79cf58/config at 11:51:
{
“uniq_id”: “csW_0cbf1e79cf58”,
“obj_id”: “csW_0cbf1e79cf58”,
“name”: “Currently ChangeScore Total”,
“dev_cla”: “power”,
“stat_t”: “currently/one/0cbf1e79cf58/state”,
“unit_of_meas”: “kW”,
“val_tpl”: “{{value_json.csW}}”
}
EDIT:
Ser sensorerna csL1, csL2 och csL3 registrerade som entities i Home assistant också.