How to show Battery Level of Fibaro Devices connected to Fibaro HC2?

Integration of Fibaro Devices connected to HC2 into HA works very good. One reason why I moved from OH2 to HA. Now I want to display the battery level of all wireless Fibaro devices as I am doing this for the Homematic window sensors. For them exist separate entities I can display. But what have I got to do, to show battery level of my Fibaro smoke, water and motion detectors?

Thanks!

Do you got the battery level as a attributes in your states? You could do some templating to show them as a sensor in your HA

What I see in settings e.g. for the motion detector:
battery_level: 51
device_armed: true
fibaro_id: 42
friendly_name: Flur 41.0
icon: mdi:run
device_class: motion
What do you mean with ‘templating’?

My code for the battery level subtracted from the attribute is as followed.

  - platform: template
    sensors:  
      battery_level_door_sensor_525:
        friendly_name: 'Batterij Level Sensor Deur Voor'
        value_template: '{{ states.binary_sensor.door_window_sensor_158d0003456525.attributes.battery_level }}'
        unit_of_measurement: '%'    

You could do the same just simply use your entity id which could be

  - platform: template
    sensors:  
      battery_level_door_sensor_525: #just an entity id you can define for your battery
        friendly_name: 'Batterij Level Sensor Deur Voor'
        value_template: '{{ states.<your entity ID>.attributes.battery_level }}'
        unit_of_measurement: '%'    

I don’t know if this makes any sense to you but you could get it working like this

So it could look like this:

 - platform: template
    sensors:  
      battery_arbeitszimmer_60_0_1_63: 
        friendly_name: 'Batterie Rauchmelder Arbeitszimmer'
        value_template: '{{ states.binary_sensor.arbeitszimmer_60_0_1_63.attributes.battery_level }}'
        unit_of_measurement: '%'``

But where have I got to put this? In the configurations.yaml or in the Template editor?

Yes that should work. You need to put this in your configuration.yaml under “sensors”. Check your config and then restart HA. You can then put it in your Lovelace as a normal entity id.

be careful with your quotation marks in your code

Wrong

       unit_of_measurement: '%'``

Correct

       unit_of_measurement: '%'
1 Like

Excelent! It is working and I am adding now all the missing entities (Power Consumption of all of my Wall-Plugs, battery level of the smoke and flood sensors,…)
Thanks!

1 Like