Skip to content

Latest commit

 

History

History
154 lines (104 loc) · 3.78 KB

tm1651.rst

File metadata and controls

154 lines (104 loc) · 3.78 KB

TM1651 Battery Display

.. seo::
    :description: Instructions for setting up TM1651 Battery Display.
    :image: tm1651_battery_display.jpg

Battery Display

The tm1651 display platform allows you to use battery display units based on the TM1651 chip such as this one with ESPHome. This component supports the level and brightness settings. All updates can be made via lambda expressions.

images/tm1651-battery-display.jpg
tm1651:
    id: tm1651_battery
    clk_pin: GPIOXX
    dio_pin: GPIOXX

Configuration variables:

tm1651.set_level_percent Action

This :ref:`Action <config-action>` changes the level of the battery display at runtime. Automatically calculates input level in percentages to actual level for the display.

on_...:
  - tm1651.set_level_percent:
      id: tm1651_battery
      level_percent: 50

Configuration variables:

tm1651.set_level Action

This :ref:`Action <config-action>` changes the level of the battery display at runtime.

on_...:
  - tm1651.set_level:
      id: tm1651_battery
      level: 5

Configuration variables:

tm1651.set_brightness Action

This :ref:`Action <config-action>` allows you to manually change the brightness of the battery display at runtime.

on_...:
  - tm1651.set_brightness:
      id: tm1651_battery
      brightness: 1

Configuration variables:

tm1651.turn_off Action

This :ref:`Action <config-action>` turns off all the LEDs.

on_...:
  - tm1651.turn_off:
      id: tm1651_battery

Configuration variables:

tm1651.turn_on Action

This :ref:`Action <config-action>` turns on the LEDs.

on_...:
  - tm1651.turn_on:
      id: tm1651_battery

Configuration variables:

Advanced Configuration

You also can control this component with lambda expressions

api:
  actions:
    - action: battery_level
      variables:
        level: int
      then:
        - lambda: |-
            id(tm1651_battery).set_level(level);
    - action: battery_brightness
      variables:
        brightness: int
      then:
        - lambda: |-
            id(tm1651_battery).set_brightness(brightness);

See Also