various packages

This commit is contained in:
zorruno
2026-07-20 19:24:35 +12:00
parent afcbf1a94b
commit d8bcf05bf6
15 changed files with 4743 additions and 5310 deletions
+81 -3
View File
@@ -1,6 +1,11 @@
################################################################################
# PACKAGE: View Road Announcement Router
################################################################################
# 1.8: Date: 2026-07-11
# - Added MQTT View Rd Feed announcement channel.
# - Added mqtt_feed script field.
# - MQTT feed publishes the current local date/time to a topic built from
# mqtt_view_rd_feed_topic_template by replacing TOPIC with mqtt_feed.
# 1.7:
# - Updated Lounge Google Home Voice to speak short_announcement only.
# - This allows long_announcement to remain available for detailed channels
@@ -14,7 +19,7 @@
# Central announcement router for general Home Assistant announcements.
# Other scripts and automations can call script.view_road_announcement and pass
# values such as channels, title, short_announcement, long_announcement,
# payload, and indicator.
# payload, indicator, and mqtt_feed.
#
# How to call this script:
#
@@ -62,7 +67,13 @@
# Blocked by default when input_boolean.quiet_time is on.
#
# mqtt_view_rd_feed:
# Placeholder only.
# Uses:
# mqtt_feed
# Publishes the current local date/time to MQTT.
# Topic format:
# viewroad-status/activityfeed/<mqtt_feed>
# Payload format:
# YYYY-MM-DD HH:MM:SS
#
# led_matrix_1:
# Uses:
@@ -285,6 +296,13 @@ script:
selector:
text:
mqtt_feed:
name: MQTT Feed Topic
description: Activity feed topic suffix. Replaces TOPIC in mqtt_view_rd_feed_topic_template.
example: "washing_machine"
selector:
text:
sequence:
##########################################################################
# PACKAGE SETTINGS / SUBSTITUTIONS
@@ -305,6 +323,7 @@ script:
default_long_announcement: "Home automation announcement"
default_payload: ""
default_indicator: ""
default_mqtt_feed: ""
quiet_time_blocked_channels:
- "google_home_voice"
@@ -322,6 +341,11 @@ script:
led_matrix_mqtt_qos: 0
led_matrix_mqtt_retain: false
mqtt_view_rd_feed_topic_template: "viewroad-status/activityfeed/TOPIC"
mqtt_view_rd_feed_datetime_format: "%Y-%m-%d %H:%M:%S"
mqtt_view_rd_feed_mqtt_qos: 0
mqtt_view_rd_feed_mqtt_retain: true
##########################################################################
# RESOLVE PASSED VALUES
##########################################################################
@@ -333,6 +357,7 @@ script:
# long_announcement
# payload
# indicator
# mqtt_feed
#
# Some uppercase variants are also accepted for tolerance.
#
@@ -395,6 +420,17 @@ script:
{{ default_indicator }}
{% endif %}
ann_mqtt_feed: >-
{% if mqtt_feed is defined %}
{{ mqtt_feed }}
{% elif MQTT_Feed is defined %}
{{ MQTT_Feed }}
{% elif Mqtt_Feed is defined %}
{{ Mqtt_Feed }}
{% else %}
{{ default_mqtt_feed }}
{% endif %}
##########################################################################
# NORMALISE CHANNEL LISTS AND MESSAGE TEXT
##########################################################################
@@ -406,6 +442,15 @@ script:
ann_quiet_time_blocked_channels_normalised: >-
{{ ',' ~ (quiet_time_blocked_channels | join(',') | lower | replace(' ', '') | replace('\n', '') | trim(',')) ~ ',' }}
ann_mqtt_feed_topic_suffix: >-
{{ ann_mqtt_feed | string | trim }}
ann_mqtt_feed_topic: >-
{{ mqtt_view_rd_feed_topic_template | replace('TOPIC', ann_mqtt_feed_topic_suffix) }}
ann_mqtt_feed_datetime: >-
{{ now().strftime(mqtt_view_rd_feed_datetime_format) }}
ann_short_announcement_raw: >-
{% if short_announcement is defined %}
{{ short_announcement }}
@@ -575,10 +620,43 @@ script:
# CHANNEL: MQTT VIEW RD FEED
##########################################################################
#
# Placeholder only. No action yet.
# Channel name:
# mqtt_view_rd_feed
#
# Uses:
# mqtt_feed
#
# Publishes the current Home Assistant local time in AM/PM format.
#
# Topic format:
# viewroad-status/activityfeed/<mqtt_feed>
#
# Example:
# mqtt_feed: "dogfed"
#
# Publishes:
# Topic: viewroad-status/activityfeed/dogfed
# Payload: 12:32 PM
#
##########################################################################
- if:
- condition: template
value_template: "{{ ',mqtt_view_rd_feed,' in ann_channels_normalised }}"
- condition: state
entity_id: input_boolean.announcement_channel_mqtt_view_rd_feed
state: "on"
- condition: template
value_template: "{{ ann_mqtt_feed_topic_suffix | string | trim | length > 0 }}"
then:
- action: mqtt.publish
data:
topic: "{{ ann_mqtt_feed_topic }}"
#payload: "{{ now().strftime('%I:%M %p') | regex_replace('^0', '') }}"
payload: "{{ now().strftime('%H:%M') }}"
qos: "{{ mqtt_view_rd_feed_mqtt_qos | int(0) }}"
retain: "{{ mqtt_view_rd_feed_mqtt_retain | bool(true) }}"
##########################################################################
# CHANNEL: LOUNGE LED MATRIX DISPLAY - MATRIX 1
##########################################################################