kevinvincent / ha-wyzesense

A Home Assistant Component to interface with the WYZE Sense hub and sensor system
369 stars 101 forks source link

battery sensor #90

Closed basesnow closed 4 years ago

basesnow commented 4 years ago

Wondering if each sensor can also report battery level as a sensor too? Would like a simple way to display all my battery levels so I can see what needs to be changed before it dies. Hopefully, integrating something like that wouldn't tax the battery more than the current setup.

SecKatie commented 4 years ago

@basesnow You can create your own with:

sensor:
  - platform: template
    sensors:
      wyzesense_<MAC>_battery_level:
        friendly_name: "<DEVICE NAME> Battery Level"
        unit_of_measurement: "%"
        value_template: "{{ state_attr('binary_sensor.wyzesense_<MAC>', 'battery_level') }}"
        device_class: battery
basesnow commented 4 years ago

awesome, thanks!