No clue where to begin with MQTT

You are the first person in the thread to mention ht16k33.

@SoCalDave I think you are on the right track. You could have run esphome on the m5stick, but the d1 should work equally well.

The code from thingiverse I donā€™t quite understand, but it should get you in the right direction.

The code from

I know this is getting a long way off-topic, but you are the one who said there was a platform for 14-segment LED displays (without a link), so show me ANY platform or component for a 14-segment LED display on Home Assistant or ESPHome. Please.

It is fastled.

Hi all, I am a little stuck on two lines in the ESPhome code for this LED clock. The two I am unsure of are:

logger:
  level: DEBUG
# Enable Home Assistant API
api:
  password: !secret hassio_api_password

ota:
  password: !secret ota_password

I donā€™t know which passwords those are (hassio_api_password and ota_password) or where to find them. Can anyone point me in the right direction?

Thank you!

secrets.yaml

Passwords for ESPHome devices are for the paranoid. You only need

api:
ota:

Passwords are optional.

When you first create the device in the ESPHome panel, ESPHome generates passwords for you. But you can use any password you want, and even the same password for every ESPHome device. Just put them in the secrets.yaml file.

Or donā€™t bother with passwords.

What this phrase is doing

password: !secret hassio_api_password

is saying ā€œget the password from the secrets.yaml file where it is stored with the name hassio_api_password.ā€

This saves you having to type the password for every esphome yaml file, and also means that when you share your yaml file with the world, you donā€™t show your password to the world.

This would not work out of the box with esphome as the FAQ tells us :bulb:

Which is the opposite of best practice as it disables any authentication :unlock:

The only password deprecated is the one for the api because it was succeeded by an encryption key which enables transport encryption which is heavily advisable for everyone :key: :white_check_mark:

Again, bad practice - please donā€™t advise such poor practices even if you donā€™t care :+1:

I never said it was a good practice, but of the many thousands of ESPHome devices around the world, can you find just ONE that was ever hacked from no API password? Just one.

For the mildly paranoid, you can use the same API password for every device. The one that ESPHome suggests is just a random number.

But passwords are not required.

image

API passwords are deprecated since half a year and shouldnā€™t be used at all anymore :point_down:

ā€œAlso, ESPHome is deprecating the old password-based authentication for its API in favor of the more secure encryption key. If one of your ESPHome devices is still using a plain password, Home Assistant will notify you by creating an issue in your Repairs dashboard.ā€

Release Notes: 2023.2: How can I Assist? - Home Assistant

Just use an encryption key which conveniently getā€™s created for you when using the ESPHome dashboard wizard to create a new node :mage:

Thatā€™s just incorrect. ESPHome by default does provide a key which is not a ā€œrandom numberā€ but a 32-byte base64 encoded string which is used as pre-shared key for encryption. :lock:

You know why ESPHome does that for you, me and others @stevemann? Because many (probably the majority) users have no or little clue about encryption and securing communications. And thatā€™s totally fine as encryption is complex and even a small bug/error can render it unsafe. Worst is probably only your suggestion to ā€œdonā€™t botherā€ and communicate in plain text without any authentication :man_facepalming:

In case you want to explore new unknowns you could start with a read of the noise protocol which is used under the hood in ESPHome. :bookmark_tabs:

Hi all,

I have another question regarding my code. I have it running, but it definitely isnā€™t formatted correctly. I believe it is using 1 pixel per segment, but I need it to use 3 pixels per segment. I know there is code I can use to define segments, but I am not sure how to implement that (where in my code it should be placed) and how to get the code to use those segments.

I can upload my code if that will help, but I appreciated any help you can provide.

Thanks!!

Please do that.

Here ya go! Thank you!!

Also, this is what the below code is displaying on my clock:

The hours and minutes are displaying on their correct digits, but the blinking dots are in the bottom right corner of the rightmost digit.

---

substitutions:
  device_name: poolclock
esphome:
  name: $device_name
  platform: ESP8266
  board: d1_mini
  on_boot:
    - light.turn_on:
        id: led_strip
        brightness: 100%
        red: 0
        green: 0
        blue: 0
        effect: ${device_name} Time effect
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Fallback Hotspot"
    password: !secret wifi_fallback_api_password
logger:
  level: DEBUG
api:
  #password: !secret hassio_api_password
  encryption:
    key: !secret hassio_api_key
ota:
  password: !secret ota_password
globals:
  - id: hours_red_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: hours_green_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: hours_blue_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: minutes_red_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: minutes_green_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: minutes_blue_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: dots_red_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: dots_green_value
    type: int
    restore_value: yes
    initial_value: "0"
  - id: dots_blue_value
    type: int
    restore_value: yes
    initial_value: "0"
output:
  - platform: template
    id: hours_red_output
    type: float
    write_action:
      lambda: id(hours_red_value) = 255.0 * state;
  - platform: template
    id: hours_green_output
    type: float
    write_action:
      lambda: id(hours_green_value) = 255.0 * state;
  - platform: template
    id: hours_blue_output
    type: float
    write_action:
      lambda: id(hours_blue_value) = 255.0 * state;
  - platform: template
    id: minutes_red_output
    type: float
    write_action:
      lambda: id(minutes_red_value) = 255.0 * state;
  - platform: template
    id: minutes_green_output
    type: float
    write_action:
      lambda: id(minutes_green_value) = 255.0 * state;
  - platform: template
    id: minutes_blue_output
    type: float
    write_action:
      lambda: id(minutes_blue_value) = 255.0 * state;
  - platform: template
    id: dots_red_output
    type: float
    write_action:
      lambda: id(dots_red_value) = 255.0 * state;
  - platform: template
    id: dots_green_output
    type: float
    write_action:
      lambda: id(dots_green_value) = 255.0 * state;
  - platform: template
    id: dots_blue_output
    type: float
    write_action:
      lambda: id(dots_blue_value) = 255.0 * state;
time:
  - platform: sntp
    id: sntp_time
    timezone: America/Los_Angeles
    servers:
      - 0.pool.ntp.org
      - 1.pool.ntp.org
      - 2.pool.ntp.org
light:
  - platform: rgb
    name: ${device_name} hours lights
    id: hours_lights
    red: hours_red_output
    green: hours_green_output
    blue: hours_blue_output
  - platform: rgb
    name: ${device_name} minutes lights
    id: minutes_lights
    red: minutes_red_output
    green: minutes_green_output
    blue: minutes_blue_output
  - platform: rgb
    name: ${device_name} dots lights
    id: dots_lights
    red: dots_red_output
    green: dots_green_output
    blue: dots_blue_output
  - platform: neopixelbus
    id: led_strip
    name: Led strip
    internal: true
    pin: GPIO2
    num_leds: 86
    variant: WS2812
    type: GRB
    effects:
      - addressable_lambda:
          name: ${device_name} Time effect
          update_interval: 200ms
          lambda: >-
            const int ledsInDigitCount = 21;

            const int digitsCount = 4;


            int digitsLeds[11][ledsInDigitCount] = {
              {0,1,1,1,1,1,1},
              {0,0,0,1,1,0,0},
              {1,0,1,1,0,1,1},
              {1,0,1,1,1,1,0},
              {1,1,0,1,1,0,0},
              {1,1,1,0,1,1,0},
              {1,1,1,0,1,1,1},
              {0,0,1,1,1,0,0},
              {1,1,1,1,1,1,1},
              {1,1,1,1,1,1,0},
              {0,0,0,0,0,0,0}
            };



            int ledOffsets[digitsCount] = {65 , 44 , 21, 0};


            auto time = id(sntp_time).now();

            int colors[4][3] = {
             {id(hours_red_value), id(hours_green_value), id(hours_blue_value)},
             {id(hours_red_value), id(hours_green_value), id(hours_blue_value)},
             {id(minutes_red_value), id(minutes_green_value), id(minutes_blue_value)},
             {id(minutes_red_value), id(minutes_green_value), id(minutes_blue_value)}
            };


            int values[digitsCount] = {};

            values[0] = time.hour / 10;

            values[1] = time.hour % 10;

            values[2] = time.minute / 10;

            values[3] = time.minute % 10;


            it.all() = Color(0,0,0);


            if ((time.second % 2) > 0) {
             it[14] = Color(id(dots_red_value), id(dots_green_value), id(dots_blue_value));
             it[15] = Color(id(dots_red_value), id(dots_green_value), id(dots_blue_value));
            }


            for (int valueI = 0; valueI < digitsCount; valueI++) {
              int ledsOffset = ledOffsets[valueI];
              int timeValue = values[valueI];
              int *color = colors[valueI];
              int *leds = digitsLeds[timeValue];


            for (int ledI = 0; ledI < ledsInDigitCount; ledI++) {
             if(leds[ledI] > 0) {
             int ledIndex = ledI + ledsOffset;
             it[ledIndex] = Color(color[0], color[1], color[2]);
             }
            }

            }

What should we see?

It should be showing numbers and the dots should be lit up. Itā€™s only lighting up part of the display.

Perhaps dividing up into partitions Light Partition ā€” ESPHome

Yeah, that is what I was thinking, but Iā€™m not sure where in my code that should go, and how to reference the partitions so that it displays correctly. Do you have any experience with this?

Thanks!!

Not much. I did some simple partitioning for some stair lights. And I canā€™t follow the logic in your code (my fault, not yours).