[Dev] Inheritance in MQTT templates?
-
@Crille at some point I had similar problems, I fixed them and I reported here. Now I cannot repro it again, but it seems very similar and related to primary attributes in base templates. It seems like the first one is used and that’s causing troubles along the hierarchy, but, as I said, I’m not able to repro it again.
-
It also looks like something may be getting a shallow copy when it needs a deep copy, and it's being modified later and polluting the other references. I'm really tied up today, but I'll look at this as soon as I can.
Did you address the template redefinitions that were being logged at startup? That has nothing to do with primary attributes; the entire template is trying to be redefined.
-
It also looks like something may be getting a shallow copy when it needs a deep copy, and it's being modified later and polluting the other references. I'm really tied up today, but I'll look at this as soon as I can.
Did you address the template redefinitions that were being logged at startup? That has nothing to do with primary attributes; the entire template is trying to be redefined.
No rush!
@toggledbits said in [Dev] Inheritance in MQTT templates?:
Did you address the template redefinitions that were being logged at startup?
You mean this?
<MQTTController:WARN> MQTTController#mqtt file zigbee2mqtt_tuya_door_sensor.yaml in /home/homebridge/reactor/config/mqtt_templates/zigbee2mqtt_tuya_door_sensor.yaml overrides existing template definition zigbee2mqtt_tuya_door_sensor
If so I don't know what to do about it, it's just the template provided in my earlier post and there is no reference/copy of it in the reactor folder/subfolders that I know of.
-
With debug level 5, that message will have another message that follows it to tell you what file originally defined it.
-
With debug level 5, that message will have another message that follows it to tell you what file originally defined it.
This?
[latest-24152]2024-06-06T19:29:35.079Z <MQTTController:5:MQTTController.js:941> MQTTController#mqtt loading template defs, considering zigbee2mqtt_tuya_door_sensor.yaml [latest-24152]2024-06-06T19:29:35.079Z <MQTTController:5:MQTTController.js:987> MQTTController#mqtt loading YAML template data from /home/homebridge/reactor/config/mqtt_templates/zigbee2mqt t_tuya_door_sensor.yaml [latest-24152]2024-06-06T19:29:35.080Z <MQTTController:WARN> MQTTController#mqtt file zigbee2mqtt_tuya_door_sensor.yaml in /home/homebridge/reactor/config/mqtt_templates/zigbee2mqtt_tuya_do or_sensor.yaml overrides existing template definition zigbee2mqtt_tuya_door_sensor [latest-24152]2024-06-06T19:29:35.080Z <MQTTController:5:MQTTController.js:918> MQTTController#mqtt previously defined in /home/homebridge/reactor/config/mqtt_templates/zigbee2mqtt_tuya_doo r_sensor.yaml/zigbee2mqtt_tuya_door_sensor.yaml
-
Uh yes...
Digging in now...
-
I need the config for all of your
zigbee2mqtt
-related entities. Just looking at the onesovrumsdorr
, I'm not able to reproduce the problem. -
Yes, but just the entities that use the
zigbee2mqtt
templates. I don't need all of it. -
entities: "zigbee2mqtt_sensor": name: "Zigbee2MQTT" topic: "zigbee2mqtt" include: my_zigbee2mqtt_sensor "datarummet": name: "Datarummet" topic: "Datarummet" include: zigbee2mqtt_tradfri_light_bulb "sovrummet": name: "Sovrummet" topic: "Sovrummet" include: zigbee2mqtt_tradfri_light_bulb_ws "milia": name: "Milia" topic: "Milia" include: zigbee2mqtt_tradfri_light_bulb_ws "hallen1": name: "Hallen 1" topic: "Hallen 1" include: zigbee2mqtt_tradfri_light_bulb "hallen2": name: "Hallen 2" topic: "Hallen 2" include: zigbee2mqtt_tradfri_light_bulb "hallen3": name: "Hallen 3" topic: "Hallen 3" include: zigbee2mqtt_tradfri_light_bulb "fonster_koket": name: "Fönster köket" topic: "Fönster köket" include: zigbee2mqtt_tradfri_light_bulb_ws "soffan": name: "Soffan" topic: "Soffan" include: zigbee2mqtt_tradfri_light_bulb_ws "framsida": name: "Framsida" topic: "Framsida" include: zigbee2mqtt_tradfri_light_bulb "skank": name: "Skänk" topic: "Skänk" include: zigbee2mqtt_tradfri_light_bulb "baksida": name: "Baksida" topic: "Baksida" include: zigbee2mqtt_tradfri_light_bulb "lampa_spel": name: "Lampa spel" topic: "Lampa spel" include: zigbee2mqtt_tradfri_light_bulb "lampa_ella": name: "Lampa Ella" topic: "Ellas rum" include: zigbee2mqtt_tradfri_light_bulb "lampa_gym": name: "Lampa gym" topic: "Lampa gym" include: zigbee2mqtt_tradfri_light_bulb "lampa_tv": name: "Lampa TV" topic: "Lampa TV" include: zigbee2mqtt_tradfri_control_outlet "vitrinskap": name: "Vitrinskåp" topic: "Vitrinskåp" include: zigbee2mqtt_tradfri_control_outlet "klimat_sovrum": name: "Klimat sovrum" topic: "Klimat sovrum" include: zigbee2mqtt_aqara_sensor_temperature_humidity "klimat_kaminen": name: "Klimat kaminen" topic: "Klimat kaminen" include: zigbee2mqtt_aqara_sensor_temperature_humidity "klimat_dusch": name: "Klimat dusch" topic: "Klimat dusch" include: zigbee2mqtt_aqara_sensor_humidity_temperature "klimat_tvattstugan": name: "Klimat tvättstugan" topic: "Klimat tvättstugan" include: zigbee2mqtt_aqara_sensor_temperature_humidity "rorelse_hallen": name: "Rörelse hallen" topic: "Rörelse hallen" include: zigbee2mqtt_aqara_light_motion_sensor "rorelse_kallaren": name: "Rörelse källaren" topic: "Rörelse källaren" include: zigbee2mqtt_aqara_light_motion_sensor "rorelse_forradet": name: "Rörelse förrådet" topic: "Rörelse förrådet" include: zigbee2mqtt_tuya_motion_light_sensor "mini_switch_1": name: "Mini Switch källaren" topic: "Mini Switch källaren" include: zigbee2mqtt_aqara_mini_switch "jul_framsida": name: "Jul Framsida" topic: "Jul Framsida" include: zigbee2mqtt_tuya_smart_plug_pm "jul_koket": name: "Jul Köket" topic: "Jul Köket" include: zigbee2mqtt_tuya_smart_plug_pm "jul_sovrummet": name: "Jul Sovrummet" topic: "Jul Sovrummet" include: zigbee2mqtt_tuya_smart_plug_pm "jul_datarummet": name: "Jul Datarummet" topic: "Jul Datarummet" include: zigbee2mqtt_tuya_smart_plug_pm "element_gillestugan": name: "Element gillestugan" topic: "Element gillestugan" include: zigbee2mqtt_tuya_smart_plug_pm "vaxtbelysning_kallare": name: "Växtbelysning källare" topic: "Växtbelysning källare" include: zigbee2mqtt_tuya_smart_plug_pm "kompressor": name: "Kompressor" topic: "Kompressor" include: zigbee2mqtt_tuya_smart_plug_pm "luftrenare": name: "Luftrenare Sovrum" topic: "Luftrenare" include: zigbee2mqtt_tuya_smart_plug_pm "uttag_uterummet": name: "Uttag uterummet" topic: "Uttag uterummet" include: zigbee2mqtt_tuya_smart_plug_pm "sovrumsdorr": name: "Sovrumsdörr" topic: "Sovrumsdörr" include: zigbee2mqtt_tuya_door_sensor "entrebelysning": name: "Entrébelysning" topic: "Entrebelysning" include: zigbee2mqtt_tuya_light_bulb_rgbcw "lampa_uterummet": name: "Lampa uterummet" topic: "Lampa uterummet" include: zigbee2mqtt_tuya_light_bulb_rgbcw
EDIT: unrelated, found entity id "jul_köket" and renamed it to "jul_koket" in post and Reactor.
-
OK. I also need the definitions for
zigbee2mqtt_tradfri_light_bulb
and all of the other templates not in thecommon
file you previously posted. -
Wait... are those just available on Github? Are your current versions published in any branch there? If so, I'll just grab them from there.
-
Looks like MQTTController 24159 solved it. I don't see any errors or warnings in the log after a restart, except all of these but I quess that's normal?
<MQTTController:WARN> MQTTController#mqtt file /home/homebridge/reactor/config/ext/MQTTController/templates/tasmota.yaml overrides existing template definition tasmota_generic_relay from /home/homebridge/reactor/config/ext/MQTTController/templates/tasmota.yaml
-
No not normal, and I don't get those.
-
Are you running more than one instance of MQTTController?
-
OK. Try 24160