Skip to content

Instantly share code, notes, and snippets.

@wwerther
Last active March 10, 2024 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwerther/8527c89be45ddd47656ab75b962cd5fd to your computer and use it in GitHub Desktop.
Save wwerther/8527c89be45ddd47656ab75b962cd5fd to your computer and use it in GitHub Desktop.
homeassistant-blueprint-awtrix-test
blueprint:
name: Awtrix Test
description: >
Test Blueprint for use with Awtrix. Based on https://flows.blueforcer.de/flow/6wqGQAmP5pe0
domain: automation
author: Walter
input:
awtrix:
name: AWTRIX Device
description: Select the Awtrix light
selector:
device:
integration: mqtt
manufacturer: Blueforcer
model: AWTRIX Light
multiple: true
app_name:
name: AWTRIX application name
description: This is the app name listed in the MQTT topic - it should be unique
selector:
text:
default: wwtest
push_icon:
name: Icon Mode
description: >
Please select the pushIcon setting for the icon
- `0` Icon doesn't move
- `1` Icon moves with text and will not appear again
- `2` Icon moves with text but appears again when the text starts to scroll again
selector:
select:
options:
- label: Icon doesn't move (default)
value: "0"
- label: Icon moves with text and will not appear again
value: "1"
- label: Icon moves with text but appears again when the text starts to scroll again
value: "2"
variables:
device_ids: !input awtrix
app: !input app_name
devices_topics: >-
{%- macro get_device_topic(device_id) %}
{{ states((device_entities(device_id) | select('search','device_topic') | list)[0]) }}
{%- endmacro %}
{%- set ns = namespace(devices=[]) %}
{%- for device_id in device_ids %}
{%- set device=get_device_topic(device_id)|replace(' ','') %}
{% set ns.devices = ns.devices + [ device ~ '/custom/'+app ] %}
{%- endfor %}
{{ ns.devices }}
push_icon: !input push_icon
payload: TEST TEST
trigger:
- platform: time_pattern
minutes: /1
condition: []
action:
- repeat:
for_each: "{{ devices_topics }}"
sequence:
- service: mqtt.publish_not
data:
qos: 0
retain: false
topic: "{{ repeat.item }}"
payload: >
{{payload}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment