Smart Home Automation Forum
automations yaml for read analog value print on SSD1306 OLED - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=89)
+--- Forum: Pi5R16 (https://www.kincony.com/forum/forumdisplay.php?fid=108)
+--- Thread: automations yaml for read analog value print on SSD1306 OLED (/showthread.php?tid=9362)



automations yaml for read analog value print on SSD1306 OLED - admin - 05-25-2026

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"