Errors after updating to MQTTController build 25139
-
I'm running MSR build 25139 on Docker, using MQTT controller 24293, and everything working as expected. But if I try to upgrade to MQTTController build 25139, I'm getting the following errors on MSR UI:
An Entity Attribute condition in "Lay-Z-Spa auto heating off" (Terrace) failed because the referenced entity "Lay-Z-Spa States" (mqtt>layzspa_states) does not have attribute value_sensor.god Last 11:20:37 An Entity Attribute condition in "Lay-Z-Spa auto heating off" (Terrace) failed because the referenced entity "Lay-Z-Spa States" (mqtt>layzspa_states) does not have attribute temperature_sensor.green Last 11:20:37 An Entity Attribute condition in "Lay-Z-Spa filter pump auto off" (Terrace) failed because the referenced entity "Lay-Z-Spa States" (mqtt>layzspa_states) does not have attribute temperature_sensor.red Last 11:20:37 An Entity Attribute condition in "Lay-Z-Spa filter pump auto run" (Terrace) failed because the referenced entity "Lay-Z-Spa States" (mqtt>layzspa_states) does not have attribute value_sensor.pump Last 11:20:37 An Entity Attribute condition in "Lay-Z-Spa watchdog" (Terrace) failed because the referenced entity "Lay-Z-Spa States" (mqtt>layzspa_states) does not have attribute value_sensor.status Last 11:20:37
My MQTT configuration (local_mqtt_devices.yaml) for the related entity is:
layzspa_message: type: ValueSensor capabilities: ["temperature_sensor", "value_sensor", "power_sensor"] primary_attribute: power_sensor.value events: "layzspa/message": "power_sensor.value": json_payload: true if_expr: '! isnull( payload?.PWR )' expr: "float(payload.PWR)" "value_sensor.air": json_payload: true if_expr: '! isnull( payload?.AIR )' expr: "float(payload.AIR)" "value_sensor.pump": json_payload: true if_expr: '! isnull( payload?.FLT )' expr: "float(payload.FLT)" "value_sensor.god": json_payload: true if_expr: '! isnull( payload?.GOD )' expr: "float(payload.GOD)" "value_sensor.lock": json_payload: true if_expr: '! isnull( payload?.LCK )' expr: "float(payload.LCK)" "value_sensor.unit": json_payload: true if_expr: '! isnull( payload?.UNT )' expr: "float(payload.UNT)" "value_sensor.error": json_payload: true if_expr: '! isnull( payload?.ERR )' expr: "float(payload.ERR)" "temperature_sensor.green": json_payload: true if_expr: '! isnull( payload?.GRN )' expr: "float(payload.GRN)" "temperature_sensor.red": json_payload: true if_expr: '! isnull( payload?.RED )' expr: "float(payload.RED)" "temperature_sensor.target": json_payload: true if_expr: '! isnull( payload?.TGT )' expr: "float(payload.TGT)" "temperature_sensor.value": json_payload: true if_expr: '! isnull( payload?.TMP )' expr: "float(payload.TMP)" "temperature_sensor.virtual": json_payload: true if_expr: '! isnull( payload?.VTM )' expr: "round(float(payload.VTM), 1)" "temperature_sensor.ambient": json_payload: true if_expr: '! isnull( payload?.AMB )' expr: "float(payload.AMB)" "layzspa/Status": "value_sensor.status": if_expr: '! isnull( payload )' expr: "payload" "layzspa/button": "value_sensor.button": if_expr: '! isnull( payload )' expr: "payload"
and in reactor.yaml I have:
"layzspa_states": name: "Lay-Z-Spa States" friendly_name: 'Lay-Z-Spa States' include: layzspa_message
I realize my MQTT configuration might be a bit unorthodox, but could there still be something unintentional in the latest MQTTController build? If needed, I can provide detailed logs.
-
You've added attribute values that aren't defined by the standard capabilities that you are using, so Reactor won't define them automatically to make sure they exist. Generally, this isn't a good idea, and one reason why custom capabilities (e.g.
x_mqtt_etc_etc_etc
are supported). You can do what you are doing for now, but these attributes won't be defined until events that set them are seen by MQTTController. -
You've added attribute values that aren't defined by the standard capabilities that you are using, so Reactor won't define them automatically to make sure they exist. Generally, this isn't a good idea, and one reason why custom capabilities (e.g.
x_mqtt_etc_etc_etc
are supported). You can do what you are doing for now, but these attributes won't be defined until events that set them are seen by MQTTController.@toggledbits so if I understood correctly, in the latest MQTTController build it won’t define these kind of attributes automatically which it used to do earlier?
-
@toggledbits so if I understood correctly, in the latest MQTTController build it won’t define these kind of attributes automatically which it used to do earlier?
@tunnus said in Errors after updating to MQTTController build 25139:
I understood correctly, in the latest MQTTController build it won’t define these kind of attributes automatically which it used to do earlier?
No, that's incorrect. It never created those attributes automatically at startup before, and it still doesn't.
Your extra attributes will be created, just not automatically at startup. They will be created when the event that writes them is received by MQTTController and processed with a valid result value, but not before. That's as it always has been. I suspect you think otherwise because when you first created the entity, there were no rules to tell you those attributes didn't exist, and by the time you got around to creating those rules, the events had been received and the attributes were added.
-
@tunnus said in Errors after updating to MQTTController build 25139:
I understood correctly, in the latest MQTTController build it won’t define these kind of attributes automatically which it used to do earlier?
No, that's incorrect. It never created those attributes automatically at startup before, and it still doesn't.
Your extra attributes will be created, just not automatically at startup. They will be created when the event that writes them is received by MQTTController and processed with a valid result value, but not before. That's as it always has been. I suspect you think otherwise because when you first created the entity, there were no rules to tell you those attributes didn't exist, and by the time you got around to creating those rules, the events had been received and the attributes were added.
@toggledbits okay, but the issue now is that, if I upgrade to MQTTController build 25139, I'll get errors which I haven't gotten before
-
Most controllers rebuild their entities when upgraded. Capabilities can change, and the new definition needs to be properly applied. Because you've chosen to add your own attributes to system-defined capabilities, those are not restored when the entity is rebuilt because Reactor knows nothing about them. In fact, to Reactor, they look like attributes from an old definition of the capability that have been removed from the most recent definition.
As I've said before, your attributes will eventually be created when the event that writes them (
layzspa/message
), with a correct payload (e.g.{ AIR: 123.456 }
), is received by MQTTController. You can wait it out, or force the device to send those events.Or, you could do this the way Reactor expects, which is to define a local capability for yourself (e.g.
x_mqtt_tunnus_layzspa
) and define your own attributes for all of the things you need. Or, break up your single entity into multiple entities that use the system capabilities unmodified.