Skip to content

Commit

Permalink
recent updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DMITRYT authored and DMITRYT committed Oct 19, 2024
1 parent d99e5fb commit 5d6613d
Show file tree
Hide file tree
Showing 32 changed files with 1,943 additions and 1,022 deletions.
114 changes: 65 additions & 49 deletions homeassistant/config/automation/auto_switcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
initial_state: 'true'
trigger:
- platform: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
from: "off"
to: "on"
action:
- wait_template: "{{ not is_state('sensor.switcher_boiler_auto_off_time', 'off') }}"
- wait_template: "{{ not is_state('sensor.switcher_kis_auto_off_time', 'off') }}"
# - service: notify.dimatelegram
# data_template:
# title: 'Boiler'
# message: "ON\nAuto off {{ states('sensor.switcher_boiler_auto_off_time') }}."
# message: "ON\nAuto off {{ states('sensor.switcher_kis_auto_off_time') }}."

- service: notify.mobile_app_iphonedima
data:
title: "Boiler"
message: "On until {{ states('sensor.switcher_boiler_auto_off_time') }}"
message: "On until {{ states('sensor.switcher_kis_auto_off_time') }}"
data:
actions:
- action: "SWITCHER_BOILER_OFF"
Expand All @@ -47,7 +47,7 @@
topic: "ulanzi_living_room/notify"
payload: |-
{
"text": "ON until {{ states('sensor.switcher_boiler_auto_off_time') }}",
"text": "ON until {{ states('sensor.switcher_kis_auto_off_time') }}",
"icon": "48802",
"textCase": "0",
"pushIcon": "2",
Expand Down Expand Up @@ -82,12 +82,12 @@
condition: and
conditions:
- condition: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
state: "on"
action:
- service: switch.turn_off
data:
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f



Expand All @@ -101,11 +101,11 @@
initial_state: 'true'
trigger:
- platform: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
from: "on"
to: "off"
action:
- wait_template: "{{ is_state('sensor.switcher_boiler_auto_off_time', 'off') }}"
- wait_template: "{{ is_state('sensor.switcher_kis_auto_off_time', 'off') }}"
# - service: notify.dimatelegram
# data_template:
# title: 'Boiler'
Expand Down Expand Up @@ -163,18 +163,22 @@
condition: and
conditions:
- condition: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
state: "off"
action:
- service: rest_command.switcher_turn_on_timer
actions:
- action: switcher_kis.turn_on_with_timer
data_template:
switcher_web_api_ip: !secret switcher_web_api_ip
switcher_web_api_port: !secret switcher_web_api_port
switcher_device_id: !secret switcher_boiler_device_id
switcher_ip: !secret switcher_boiler_local_ip_addr
minutes: '15'
- service: homeassistant.update_entity
entity_id: sensor.switcher_boiler
entity_id: switch.switcher_touch_d54f
timer_minutes: '15'
# - service: rest_command.switcher_turn_on_timer
# data_template:
# switcher_web_api_ip: !secret switcher_web_api_ip
# switcher_web_api_port: !secret switcher_web_api_port
# switcher_device_id: !secret switcher_boiler_device_id
# switcher_ip: !secret switcher_boiler_local_ip_addr
# minutes: '15'
# - service: homeassistant.update_entity
# entity_id: sensor.switcher_boiler


############################################################################
Expand All @@ -194,18 +198,22 @@
condition: and
conditions:
- condition: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
state: "off"
action:
- service: rest_command.switcher_turn_on_timer
actions:
- action: switcher_kis.turn_on_with_timer
data_template:
switcher_web_api_ip: !secret switcher_web_api_ip
switcher_web_api_port: !secret switcher_web_api_port
switcher_device_id: !secret switcher_boiler_device_id
switcher_ip: !secret switcher_boiler_local_ip_addr
minutes: '30'
- service: homeassistant.update_entity
entity_id: sensor.switcher_boiler
entity_id: switch.switcher_touch_d54f
timer_minutes: '30'
# - service: rest_command.switcher_turn_on_timer
# data_template:
# switcher_web_api_ip: !secret switcher_web_api_ip
# switcher_web_api_port: !secret switcher_web_api_port
# switcher_device_id: !secret switcher_boiler_device_id
# switcher_ip: !secret switcher_boiler_local_ip_addr
# minutes: '30'
# - service: homeassistant.update_entity
# entity_id: sensor.switcher_boiler


############################################################################
Expand All @@ -225,18 +233,22 @@
condition: and
conditions:
- condition: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
state: "off"
action:
- service: rest_command.switcher_turn_on_timer
actions:
- action: switcher_kis.turn_on_with_timer
data_template:
switcher_web_api_ip: !secret switcher_web_api_ip
switcher_web_api_port: !secret switcher_web_api_port
switcher_device_id: !secret switcher_boiler_device_id
switcher_ip: !secret switcher_boiler_local_ip_addr
minutes: '45'
- service: homeassistant.update_entity
entity_id: sensor.switcher_boiler
entity_id: switch.switcher_touch_d54f
timer_minutes: '45'
# - service: rest_command.switcher_turn_on_timer
# data_template:
# switcher_web_api_ip: !secret switcher_web_api_ip
# switcher_web_api_port: !secret switcher_web_api_port
# switcher_device_id: !secret switcher_boiler_device_id
# switcher_ip: !secret switcher_boiler_local_ip_addr
# minutes: '45'
# - service: homeassistant.update_entity
# entity_id: sensor.switcher_boiler


############################################################################
Expand All @@ -256,15 +268,19 @@
condition: and
conditions:
- condition: state
entity_id: switch.switcher_boiler
entity_id: switch.switcher_touch_d54f
state: "off"
action:
- service: rest_command.switcher_turn_on_timer
actions:
- action: switcher_kis.turn_on_with_timer
data_template:
switcher_web_api_ip: !secret switcher_web_api_ip
switcher_web_api_port: !secret switcher_web_api_port
switcher_device_id: !secret switcher_boiler_device_id
switcher_ip: !secret switcher_boiler_local_ip_addr
minutes: '60'
- service: homeassistant.update_entity
entity_id: sensor.switcher_boiler
entity_id: switch.switcher_touch_d54f
timer_minutes: '60'
# - service: rest_command.switcher_turn_on_timer
# data_template:
# switcher_web_api_ip: !secret switcher_web_api_ip
# switcher_web_api_port: !secret switcher_web_api_port
# switcher_device_id: !secret switcher_boiler_device_id
# switcher_ip: !secret switcher_boiler_local_ip_addr
# minutes: '60'
# - service: homeassistant.update_entity
# entity_id: sensor.switcher_boiler
178 changes: 89 additions & 89 deletions homeassistant/config/automation/auto_updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,51 +65,51 @@
# #
############################################################################

- id: hacs_updates_notification
alias: HACS Updates Notification
trigger:
- platform: state
entity_id: sensor.hacs
- platform: time_pattern
hours: '/2'
minutes: 0
seconds: 0
condition:
- condition: template
value_template: "{{ states('sensor.hacs') != 'unknown'}}"
- condition: template
value_template: "{{ (states('sensor.hacs') | float) != 0}}"
action:
#- service: notify.dimatelegram
- service: notify.mobile_app_iphonedima
data_template:
title: Updates pending in HACS
message: >-
{% for repo in state_attr('sensor.hacs', 'repositories') %}
{{ repo.display_name }}: {{ repo["installed_version"] }} -> {{ repo["available_version"] }}
{% endfor %}
- service: persistent_notification.create
data:
message: >-
{% for repo in state_attr('sensor.hacs', 'repositories') %}
{{ repo.display_name }}: {{ repo["installed_version"] }} -> {{ repo["available_version"] }}
{% endfor %}
# - id: hacs_updates_notification
# alias: HACS Updates Notification
# trigger:
# - platform: state
# entity_id: sensor.hacs
# - platform: time_pattern
# hours: '/2'
# minutes: 0
# seconds: 0
# condition:
# - condition: template
# value_template: "{{ states('sensor.hacs') != 'unknown'}}"
# - condition: template
# value_template: "{{ (states('sensor.hacs') | float) != 0}}"
# action:
# #- service: notify.dimatelegram
# - service: notify.mobile_app_iphonedima
# data_template:
# title: Updates pending in HACS
# message: >-
# {% for repo in state_attr('sensor.hacs', 'repositories') %}
# {{ repo.display_name }}: {{ repo["installed_version"] }} -> {{ repo["available_version"] }}
# {% endfor %}
# - service: persistent_notification.create
# data:
# message: >-
# {% for repo in state_attr('sensor.hacs', 'repositories') %}
# {{ repo.display_name }}: {{ repo["installed_version"] }} -> {{ repo["available_version"] }}
# {% endfor %}

[HACS](/hacs)
title: "Updates pending in HACS"
notification_id: "10002"
# [HACS](/hacs)
# title: "Updates pending in HACS"
# notification_id: "10002"


- id: hacs_updates_notification_dismiss
alias: HACS Updates Notification Dismiss
trigger:
- platform: state
entity_id: sensor.hacs
to: '0'
action:
service: persistent_notification.dismiss
data:
notification_id: "10002"
# - id: hacs_updates_notification_dismiss
# alias: HACS Updates Notification Dismiss
# trigger:
# - platform: state
# entity_id: sensor.hacs
# to: '0'
# action:
# service: persistent_notification.dismiss
# data:
# notification_id: "10002"



Expand All @@ -119,56 +119,56 @@
# #
############################################################################

- id: Tasmota_updates_notification
alias: Tasmota Updates Notification
trigger:
- platform: state
entity_id: sensor.number_of_tasmota_versions_old
not_to: '0'
- platform: time_pattern
hours: '/2'
minutes: 0
seconds: 0
condition:
- condition: template
value_template: "{{ states('sensor.tasmota_latest') != 'unknown' }}"
- condition: template
value_template: "{{ states('sensor.tasmota_latest') != 'unavailable' }}"
- condition: template
value_template: "{{ states('sensor.tasmota_latest') != 'latest' }}"
- condition: template
value_template: "{{ states('sensor.number_of_tasmota_versions_old') != 'unknown' }}"
- condition: template
value_template: "{{ states('sensor.number_of_tasmota_versions_old') != 'unavailable' }}"
- condition: template
value_template: "{{ states('sensor.number_of_tasmota_versions_old') != '0' }}"
action:
#- service: notify.dimatelegram
- service: notify.mobile_app_iphonedima
data_template:
title: "Tasmota device(s) outdated"
message: |
{{ states('sensor.number_of_tasmota_versions_old') }} Tasmota device(s) outdated.
- service: persistent_notification.create
data:
message: |
{{ states('sensor.number_of_tasmota_versions_old') }} Tasmota device(s) outdated.
# - id: Tasmota_updates_notification
# alias: Tasmota Updates Notification
# trigger:
# - platform: state
# entity_id: sensor.number_of_tasmota_versions_old
# not_to: '0'
# - platform: time_pattern
# hours: '/2'
# minutes: 0
# seconds: 0
# condition:
# - condition: template
# value_template: "{{ states('sensor.tasmota_latest') != 'unknown' }}"
# - condition: template
# value_template: "{{ states('sensor.tasmota_latest') != 'unavailable' }}"
# - condition: template
# value_template: "{{ states('sensor.tasmota_latest') != 'latest' }}"
# - condition: template
# value_template: "{{ states('sensor.number_of_tasmota_versions_old') != 'unknown' }}"
# - condition: template
# value_template: "{{ states('sensor.number_of_tasmota_versions_old') != 'unavailable' }}"
# - condition: template
# value_template: "{{ states('sensor.number_of_tasmota_versions_old') != '0' }}"
# action:
# #- service: notify.dimatelegram
# - service: notify.mobile_app_iphonedima
# data_template:
# title: "Tasmota device(s) outdated"
# message: |
# {{ states('sensor.number_of_tasmota_versions_old') }} Tasmota device(s) outdated.
# - service: persistent_notification.create
# data:
# message: |
# {{ states('sensor.number_of_tasmota_versions_old') }} Tasmota device(s) outdated.

[More](/lovelace/tiles_tasmota)
title: "Tasmota device(s) outdated"
notification_id: "10003"
# [More](/lovelace/tiles_tasmota)
# title: "Tasmota device(s) outdated"
# notification_id: "10003"


- id: tasmota_updates_notification_dismiss
alias: Tasmota Updates Notification Dismiss
trigger:
- platform: state
entity_id: sensor.number_of_tasmota_versions_old
to: '0'
action:
service: persistent_notification.dismiss
data:
notification_id: "10003"
# - id: tasmota_updates_notification_dismiss
# alias: Tasmota Updates Notification Dismiss
# trigger:
# - platform: state
# entity_id: sensor.number_of_tasmota_versions_old
# to: '0'
# action:
# service: persistent_notification.dismiss
# data:
# notification_id: "10003"



Expand Down
Loading

0 comments on commit 5d6613d

Please sign in to comment.