Smart Home Automation Forum

Full Version: automations yaml for read analog value print on SSD1306 OLED
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
here is automations.yaml file show analog data on SSD1306 OLED every 5 seconds.
Code:
- id: ads1115_ssd1306_display
  alias: "ADS1115 to SSD1306 (A1-A4)"
  trigger:
    - platform: time_pattern
      seconds: "/5"
  action:
    - service: ssd1306_i2c.print_text
      data:
        x: 0
        y: 0
        clear: true
        font_size: 12
        text: "A1: {{ states('sensor.a1') | float(0) | round(3) }} V\nA2: {{ states('sensor.a2') | float(0) | round(3) }} V\nA3: {{ states('sensor.a3') | float(0) | round(3) }} mA\nA4: {{ states('sensor.a4') | float(0) | round(3) }} mA"