So next morning, some coffee and a few hours later of reading more documentation and more trial and error I now think I have it working correctly.
What I did was to delete the sensors that was automatically created in MQTT after Zigbee2mqtt created them (sorry if I explain this wrong), I then made my own in configuration.yaml with this code.
mqtt:
sensor:
- name: 'Boiler Zig Probe 1'
state_topic: 'zigbee2mqtt/0x00124b0023a8b86e'
unit_of_measurement: "°C"
value_template: "{{ value_json.l1 | round(1) }}"
unique_id: sensor.0x00124b0023a8b86e.l1
- name: 'Boiler Zig Probe 2'
state_topic: 'zigbee2mqtt/0x00124b0023a8b86e'
unit_of_measurement: "°C"
value_template: "{{ value_json.l2 | round(1) }}"
unique_id: sensor.0x00124b0023a8b86e.l2
- name: 'Boiler Zig Probe 3'
state_topic: 'zigbee2mqtt/0x00124b0023a8b86e'
unit_of_measurement: "°C"
value_template: "{{ value_json.l3 | round(1) }}"
unique_id: sensor.0x00124b0023a8b86e.l3
- name: 'Boiler Zig Probe 4'
state_topic: 'zigbee2mqtt/0x00124b0023a8b86e'
unit_of_measurement: "°C"
value_template: "{{ value_json.l4 | round(1) }}"
unique_id: sensor.0x00124b0023a8b86e.l4
- name: 'Boiler Zig Probe 5'
state_topic: 'zigbee2mqtt/0x00124b0023a8b86e'
unit_of_measurement: "°C"
value_template: "{{ value_json.l5 | round(1) }}"
unique_id: sensor.0x00124b0023a8b86e.l5
If this is correct and will work after HA 2022.12 I have no clue, the error message does not show again after I clicked “Ignore” on it once so I guess time will tell, if someone sees something wrong let me know!
Edit… a few days later
So, after my first test run I can inform anyone trying to build this (keep in mind I used 5 sensors) that it lasted around 9-10 hours on a 18650 cell charged to 3.6V (still waiting on my DC-DC converter), in other words I need to look into the premium version of PTVO since that allows the following,
“* It allows you to create battery-powered DIY devices with effective power management.”
I can also as a tip mention that
state_topic: 'zigbee2mqtt/0x00124b0023a8b86e'
This part ( 0x00124b0023a8b86e ) of that code is the friendly name of the device in zigbee2mqtt, so if you rename it in Z2M like I did… you need to also change the configuration.yaml to reflect that, wasted a few hours on that last night also
Edit 14.11.2022 (since I have posted the last 3 posts in a row I am not allowed to post again before someone else does )
So today I took the time to look into “Model ID” in PTVO, after reading up on it I added my own, saved a custom converter for Z2M and uploaded it to “config/zigbee2mqtt/” after that I edited “config/zigbee2mqtt/configuration.yaml” and added my custom convert.
external_converters:
- your_custom_convert_here.js
After this I removed the old sensor, restarted HA (seems some data i still there otherwise and the sensor does not get removed completely, if added again before reboot it keeps old model ID and other variables… guess it has something to do with how addons work in HA or something maybe, a restart of Z2M might be enough but I rebooted to be on the safe side)
Once rebooted I flashed the sensor again with my new firmware (I did btw get a license for PTVO to be able to make my sensor a PSM model, absolutely worth it! great software so happy to support the developer) and added it to Z2M, the wonderful thing about the custom convert is that the sensor gets added like any other “of the shelf” supported sensor since it gets recognized by the custom convert, so no more need to add the sensor via custom code for MQTT everything just works much smoother!