Created
December 2, 2024 22:48
-
-
Save 01-Scripts/46dca5223230383e60af7063ada27142 to your computer and use it in GitHub Desktop.
WordClock/Support for HomeAssistant https://www.mikrocontroller.net/articles/WordClock_mit_WS2812
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the folowing helpers in Home Assistant: | |
# Name | Entity ID | Type | |
# ---------------------------------------------------------------------------------------------------------------- | |
# wordclock_status | input_boolean.wordclock_status | input_boolean | |
# Wordclock IP | input_text.wordclock_ip | input_text (Min:0 Max:100,Text) Enter the IP-Adress of your Wordclock | |
# wordclock_ambi_b | input_number.wordclock_ambi_b | input_number (Min:0 Max:255, Step:1) | |
# wordclock_ambi_g | input_number.wordclock_ambi_g | input_number (Min:0 Max:255, Step:1) | |
# wordclock_ambi_r | input_number.wordclock_ambi_r | input_number (Min:0 Max:255, Step:1) | |
# wordclock_ambi_brightness | input_number.wordclock_ambi_brightness | input_number (Min:1 Max:255, Step:1) | |
# wordclock_display_b | input_number.wordclock_display_b | input_number (Min:0 Max:255, Step:1) | |
# wordclock_display_g | input_number.wordclock_display_g | input_number (Min:0 Max:255, Step:1) | |
# wordclock_display_r | input_number.wordclock_display_r | input_number (Min:0 Max:255, Step:1) | |
# wordclock_display_brightness | input_number.wordclock_display_brightness | input_number (Min:1 Max:255, Step:1) | |
# Add the following configuration in your configuration.yaml and restart HA | |
light: !include light.yaml | |
rest_command: | |
wc_on: | |
url: "http://{{ states('input_text.wordclock_ip') }}/display?action=poweron" | |
method: get | |
wc_off: | |
url: "http://{{ states('input_text.wordclock_ip') }}/display?action=poweroff" | |
method: get | |
wc_send_ticker: | |
url: "http://{{ states('input_text.wordclock_ip') }}/?ticker={{ text }}&action=saveticker" | |
method: get | |
wc_set_display_color: | |
url: "http://{{ states('input_text.wordclock_ip') }}/display?red={{ states('input_number.wordclock_display_r') | float / 4 | int}}&green={{ states('input_number.wordclock_display_g') | float / 4 | int}}&blue={{ states('input_number.wordclock_display_b') | float / 4 | int}}&action=savecolors" | |
method: get | |
wc_set_display_brightness: | |
url: "http://{{ states('input_text.wordclock_ip') }}/display?brightness={{ states('input_number.wordclock_display_brightness') | float / 17 | int}}&action=savebrightness" | |
method: get | |
wc_set_ambi_mode_normal: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?ambimode=0&action=saveambimode" | |
method: get | |
wc_set_ambi_mode_clock: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?ambimode=1&action=saveambimode" | |
method: get | |
wc_set_ambi_mode_rainbow: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?ambimode=3&action=saveambimode" | |
method: get | |
wc_set_ambi_own_color: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?action=savesyncambi" | |
method: get | |
wc_set_ambi_2_display_color: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?syncambi=active&action=savesyncambi" | |
method: get | |
wc_set_ambi_color: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?red={{ states('input_number.wordclock_ambi_r') | float / 4 | int}}&green={{ states('input_number.wordclock_ambi_g') | float / 4 | int}}&blue={{ states('input_number.wordclock_ambi_b') | float / 4 | int}}&action=savecolors" | |
method: get | |
wc_set_ambi_brightness: | |
url: "http://{{ states('input_text.wordclock_ip') }}/ambilight?brightness={{ states('input_number.wordclock_ambi_brightness') | float / 17 | int}}&action=savebrightness" | |
method: get | |
wc_test_display: | |
url: "http://{{ states('input_text.wordclock_ip') }}/display?action=testdisplay" | |
method: get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: template | |
lights: | |
word_clock: | |
friendly_name: "Word Clock" | |
unique_id: "word_clock" | |
level_template: "{{ states('input_number.wordclock_display_brightness') | int}}" | |
value_template: "{{ states('input_boolean.wordclock_status') }}" | |
rgb_template: ( | |
{{ states('input_number.wordclock_display_r') | int}}, | |
{{ states('input_number.wordclock_display_g') | int}}, | |
{{ states('input_number.wordclock_display_b') | int}}, | |
) | |
turn_on: | |
- action: rest_command.wc_on | |
- action: input_boolean.turn_on | |
target: | |
entity_id: input_boolean.wordclock_status | |
turn_off: | |
- action: rest_command.wc_off | |
- action: input_boolean.turn_off | |
target: | |
entity_id: input_boolean.wordclock_status | |
set_level: | |
- action: input_number.set_value | |
target: | |
entity_id: input_number.wordclock_display_brightness | |
data: | |
value: "{{ brightness }}" | |
- action: rest_command.wc_set_display_brightness | |
set_rgb: | |
- action: input_number.set_value | |
target: | |
entity_id: input_number.wordclock_display_r | |
data: | |
value: "{{ r }}" | |
- action: input_number.set_value | |
target: | |
entity_id: input_number.wordclock_display_g | |
data: | |
value: "{{ g }}" | |
- action: input_number.set_value | |
target: | |
entity_id: input_number.wordclock_display_b | |
data: | |
value: "{{ b }}" | |
- action: rest_command.wc_set_display_color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested & Used with WordClock FW Version 2.4.2