I have no clue what I am doing. After about 10 days of cutting and pasting, poke and hope I have it working, but…
It scrolls the text from right to left fine, but when it starts and when it loops it is at top left so to speak. It does not begin scrolling from the right so I have to pad my message with stuff like asterisk dash asterisk -- Welcome to my home ! If I do not pad it Welcome scrolls away before you can read it. I tried changing the code to TOP_RIGHT but that did not work.
Anyone have a suggestion?
Thanks,
Grey
# mosquitto_pub -h mqtthost -t text/text -m "Hi there!"
substitutions:
devicename: leggedlamp
xscrollpadding: "4" # in pix
esphome:
name: btfmatrix
platform: ESP8266
board: nodemcuv2
on_boot:
priority: -10
then: # stop the flickering
- lambda: |-
fastled_base_fastledlightoutput->get_controller()->setDither(0);
wifi:
networks:
- ssid: "****"
password: "****"
- ssid: "***"
password: ""
manual_ip:
static_ip: 192.168.1.49
gateway: 192.168.1.1
subnet: 255.255.255.0
dns1: 192.168.1.1
mqtt:
id: mqtt_client
broker: 192.168.1.50
username: "****"
password: "****"
text_sensor:
- platform: mqtt_subscribe
name: "Text4"
id: extratext
topic: text/text4
# Enable logging
logger:
# level: VERBOSE
# Enable Home Assistant API
api:
ota:
font:
- id: tinyfont
file: "DejaVuSans-Bold.ttf"
size: 9
glyphs: '♡Ωäöüß!"%()+,-_.:*=°?~#0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz'
time:
- platform: sntp
id: rtctime
light:
- platform: fastled_clockless
chipset: WS2812B
pin: GPIO2
num_leds: 256
rgb_order: GRB
# rgb_order: GRB
name: "led_matrix"
id: led_matrix_32x8
default_transition_length: 0s
color_correct: [30%, 30%, 30%]
restore_mode: ALWAYS_ON
display:
- platform: addressable_light
addressable_light_id: led_matrix_32x8
width: 32
height: 8
pixel_mapper: |-
if (x % 2 == 0) {
return (x * 8) + y;
}
return (x * 8) + (7 - y);
rotation: 0°
update_interval: 50ms
lambda: |-
static uint16_t xpos = 0;
const char * text = id(extratext).state.c_str();
int x_start, y_start;
int width, height;
it.get_text_bounds(0, 0, text, id(tinyfont),
TextAlign::TOP_LEFT, &x_start, &y_start, &width, &height);
it.print(-(xpos % (width + $xscrollpadding)), -2,
id(tinyfont), Color(0xFFFF00),
TextAlign::TOP_LEFT, text);
xpos++;