this post was submitted on 02 Mar 2024
7 points (100.0% liked)

homeassistant

12080 readers
6 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS
 

I have some sensors like this one:


  - name: "Sala"
    unique_id: "temp_sala"
    state_topic: "zigbee2mqtt/temp_sala"
    value_template: "{{ value_json.temperature }}"
    unit_of_measurement: "°C"

Those sensors publish the battery status too, how can I add it? Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] CondorWonder@lemmy.ca 1 points 8 months ago (1 children)

Zigbee2mqtt should do device auto discovery by default (it did for me and I didn’t have to do anything). Maybe you’ve turned something off? The alternative I can think of is to manually create and maintain device auto discovery records like https://stevessmarthomeguide.com/adding-an-mqtt-device-to-home-assistant/ shows (for example).

[–] peregus@lemmy.world 1 points 8 months ago (1 children)

Zigbee2mqtt should do device auto discovery by default

It does, but this is a remore device and I don't wanna redirect all the homeassistant/# messages from zigbee2mqtt to my home MQTT broker.

[–] CondorWonder@lemmy.ca 1 points 8 months ago

Then to link the entities together into a device you need to mimic the auto discovery, or you just have two split entities.

I suppose you could create a template entity with the battery as an attribute to see it in the details view, but you still need the entities with the raw data. I’d be more inclined to create the device with auto discovery, seems like a cleaner way to go.