Open danieljkemp opened 8 months ago
can you try this?
service: esphome.bedroom_clock_set_clock_color
data:
r: 255
g: 0
b: 0
assuming your ulanzi is named "bedroom_clock"
- EspHoMaTriXv2 version: 2023.7.0
In readme i see:
set_clock_color
since clock_screen
and date_screen
will set color anywaycan you try this?
service: esphome.bedroom_clock_set_clock_color data: r: 255 g: 0 b: 0
assuming your ulanzi is named "bedroom_clock"
Aww heck well first, yeah it works, but it thinks I have a 6 pixel font and throws the 8 pixel font up so I am gonna have to figure out how that is configured, also it goes black for a moment after setting it, that is probably a result of how I set up the clock screen (current goal is to use it 100% as a clock)
and then is there a way to clear out the old functions from HA? I had deleted it from HA then re-added it and the old servie shows still
Thanks for the help! :D
the pixel change was a pretty simple oversight
Huh, seems like there is some other empty screen that the clock is alternating with some other screen (that I don't think I have set???) so ends up alternating black/clock
the clock_time
setting was removed at some point I used to set clock_time=clock_interval to make it function as a pure clock and it was great
so I set my auto-adjust automation to match the color to the room lights (and red if below a threshhold) and now.... it alternates between red and blue? Blue? Why blue, I have no clue I feel like I am slowly going insane. Is there no longer a way to lock the screen to a clock with a certain color?
service: esphome.bedroom_clock_clock_screen
data:
default_font: true
lifetime: 5
screen_time: 5
r: 255
g: 0
b: 0
After calling that with clock_interval=5 it alternates between red and blue somehow?
Hi, nice idea with the color synchronization to your room light!
can you provide a esphome-log of the red blue toggle effect?
[15:32:16][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
[15:32:26][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
[15:32:26][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
[15:32:36][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
[15:32:36][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
[15:32:46][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
[15:32:46][I][EHMTXv2:1007]: set_brightness 100 => 39.22 %
Here is the HA automation that I am using to control the clock (I see in the docs I could do the brightness on-device, and I might eventually do that)
alias: "Bedroom Clock: Auto Brightness"
description: ""
trigger:
- platform: state
entity_id:
- sensor.ulanzi_illuminance
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.ulanzi_illuminance
below: 100
sequence:
- service: esphome.bedroom_clock_brightness
data:
value: 30
- conditions:
- condition: numeric_state
entity_id: sensor.ulanzi_illuminance
above: 101
below: 199
sequence:
- service: esphome.bedroom_clock_brightness
data:
value: 75
- conditions:
- condition: numeric_state
entity_id: sensor.ulanzi_illuminance
above: 200
below: 299
sequence:
- service: esphome.bedroom_clock_brightness
data:
value: 100
- conditions:
- condition: numeric_state
entity_id: sensor.ulanzi_illuminance
above: 300
sequence:
- service: esphome.bedroom_clock_brightness
data:
value: 150
- if:
- condition: numeric_state
entity_id: sensor.ulanzi_illuminance
above: 100
then:
- condition: state
entity_id: light.bedroom
state: "on"
- service: esphome.bedroom_clock_set_clock_color
data:
r: "{{ state_attr('light.bedroom', 'rgb_color').0 | int }}"
g: "{{ state_attr('light.bedroom', 'rgb_color').1 | int }}"
b: "{{ state_attr('light.bedroom', 'rgb_color').2 | int }}"
enabled: false
- service: esphome.bedroom_clock_clock_screen
data:
lifetime: 5
screen_time: 5
default_font: true
r: "{{ state_attr('light.bedroom', 'rgb_color').0 | int }}"
g: "{{ state_attr('light.bedroom', 'rgb_color').1 | int }}"
b: "{{ state_attr('light.bedroom', 'rgb_color').2 | int }}"
else:
- service: esphome.bedroom_clock_set_clock_color
data:
r: 255
g: 0
b: 0
enabled: false
- service: esphome.bedroom_clock_clock_screen
data:
default_font: true
lifetime: 5
screen_time: 5
r: 255
g: 0
b: 0
mode: single
Now it is flashing between the light color and white? For now the goal is for it to just be a clock/light sensor. It feels like there are two clock screens it is alternating between for some reason?
I think there are two clock screens in your queue, one with the default color ("white") and your adapted color so you should delete all clock_screens in the queue before setting the color.
service: esphome.ulanzi_del_screen
data:
icon_name: "*"
mode: 2
ahha I thik I figured it out
since I'm not using other screens at the moment when set_clock_color is called, it deletes the clock screens (https://github.com/lubeda/EspHoMaTriXv2/blob/4df039378c86203316f0c8f23f08b166350f1e9a/components/ehmtxv2/EHMTX.cpp#L397) which then triggers the clock to reboot and go black for a moment, if there was a queue it wouldn't be as noticeable
using the clock_screen function an additional clock is added to the queue which ends up alternating with other screens if I was to change color
For now I am gonna set the color to red (least harsh at night) and disable the color changing in my HA script.
just thinking/rambling sorry in advance....
using the clock_screen directly, lifetime can't be super long or it'll never change colors, and if it is too short it'll fizzle and cause the screen to reset, goal is keep the clock from flashing unpredictably, maybe an option for lifetime in seconds could help in general?
the set_clock_color probably deletes because it can't actually change a live screen? maybe it should only do that if the color would actually be changed, like a check for current color vs parameter?
I am thinking of adding an indicator dot or changing colors based on HA assist, like changing the : or adding a corner dot when a wake-word is triggered or command received but gotta get the rest figured out first
since I'm not using other screens at the moment when set_clock_color is called, it deletes the clock screens
Its reworked in 2024.1.0
Bug report
Describe the bug
After updating to v2, the following error occurs in HA when attempting to call the clock_color servie
Additional information
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Clock color change without a error log
Configuration
Logs
see above
Services calls