From d813717d2c084424ae1f1f3a009fa468d40e160c Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Sun, 27 Sep 2026 16:43:35 +0200 Subject: [PATCH] common: enable ha_time in common packages, devices extend it Move the homeassistant time platform (id ha_time) into all common packages. Devices with custom triggers now use '!extend ha_time'; plain duplicate time blocks are removed. mcu-lvgl's unused time_comp is unified to ha_time. --- common/common.yaml | 4 ++-- common/common_dev.yaml | 3 +++ common/common_esp8266.yaml | 3 +++ common/common_eth.yaml | 3 +++ common/common_wo_debug.yaml | 3 +++ mcu-atoms3.yaml | 3 +-- mcu-basement.yaml | 3 +-- mcu-cec-bedroom.yaml | 5 ----- mcu-clock-1.yaml | 5 ----- mcu-clock-living-room.yaml | 5 ----- mcu-eworkbench.yaml | 5 ----- mcu-fireplace.yaml | 5 ----- mcu-heater.yaml | 4 +--- mcu-kitchen.yaml | 5 ----- mcu-lvgl.yaml | 4 ---- mcu-m5paper.yaml | 4 +--- mcu-mains-power.yaml | 4 +--- mcu-nspanel-bedroom.yaml | 4 +--- mcu-nspanel-dev.yaml | 5 ----- mcu-nspanel-fireplace.yaml | 5 ----- mcu-nspanel-office-j.yaml | 5 ----- mcu-nspanel-office-r.yaml | 5 ----- mcu-nspanel-patio.yaml | 5 ----- mcu-patio.yaml | 5 ----- mcu-pow-dishwasher.yaml | 2 -- mcu-pow-washer.yaml | 5 +---- mcu-shed.yaml | 2 -- mcu-socket-01.yaml | 3 +-- mcu-socket-02.yaml | 3 +-- mcu-socket-03.yaml | 3 +-- mcu-stackchan.yaml | 1 - mcu-well.yaml | 2 -- 32 files changed, 24 insertions(+), 99 deletions(-) diff --git a/common/common.yaml b/common/common.yaml index 327a16d..5305a0c 100644 --- a/common/common.yaml +++ b/common/common.yaml @@ -24,8 +24,8 @@ text_sensor: # - <<: !include text_sensor/uptime.yaml - <<: !include text_sensor/wifi_info.yaml -# time: -#. - <<: !include time/homeassistant.yaml +time: + - <<: !include time/homeassistant.yaml network: enable_ipv6: true diff --git a/common/common_dev.yaml b/common/common_dev.yaml index 7e9a695..d8546c2 100644 --- a/common/common_dev.yaml +++ b/common/common_dev.yaml @@ -24,5 +24,8 @@ text_sensor: - <<: !include text_sensor/version.yaml - <<: !include text_sensor/wifi_info.yaml +time: + - <<: !include time/homeassistant.yaml + network: enable_ipv6: true \ No newline at end of file diff --git a/common/common_esp8266.yaml b/common/common_esp8266.yaml index 308f329..106f561 100644 --- a/common/common_esp8266.yaml +++ b/common/common_esp8266.yaml @@ -23,5 +23,8 @@ text_sensor: - <<: !include text_sensor/version.yaml - <<: !include text_sensor/wifi_info.yaml +time: + - <<: !include time/homeassistant.yaml + network: enable_ipv6: true \ No newline at end of file diff --git a/common/common_eth.yaml b/common/common_eth.yaml index e5a726b..2201383 100644 --- a/common/common_eth.yaml +++ b/common/common_eth.yaml @@ -21,5 +21,8 @@ text_sensor: - <<: !include text_sensor/version.yaml - <<: !include text_sensor/ethernet_info.yaml +time: + - <<: !include time/homeassistant.yaml + network: enable_ipv6: true diff --git a/common/common_wo_debug.yaml b/common/common_wo_debug.yaml index d6ff29b..d768f69 100644 --- a/common/common_wo_debug.yaml +++ b/common/common_wo_debug.yaml @@ -27,3 +27,6 @@ text_sensor: - <<: !include text_sensor/git_ref.yaml - <<: !include text_sensor/version.yaml - <<: !include text_sensor/wifi_info.yaml + +time: + - <<: !include time/homeassistant.yaml diff --git a/mcu-atoms3.yaml b/mcu-atoms3.yaml index 25335ba..0aed7ae 100644 --- a/mcu-atoms3.yaml +++ b/mcu-atoms3.yaml @@ -491,8 +491,7 @@ sensor: # name: Dallas Temp 4 # one_wire_id: hub_1 -time: - - !include common/time/homeassistant.yaml +# time: # - platform: sntp # id: sntp_time # timezone: Europe/Bratislava diff --git a/mcu-basement.yaml b/mcu-basement.yaml index d311d2d..8ae5afd 100644 --- a/mcu-basement.yaml +++ b/mcu-basement.yaml @@ -139,8 +139,7 @@ switch: id: relay_2 time: - - platform: homeassistant - timezone: Europe/Bratislava + - id: !extend ha_time on_time: - seconds: 0 minutes: /15 diff --git a/mcu-cec-bedroom.yaml b/mcu-cec-bedroom.yaml index 4ba88ef..9ace799 100644 --- a/mcu-cec-bedroom.yaml +++ b/mcu-cec-bedroom.yaml @@ -31,11 +31,6 @@ packages: debug: -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - i2c: # - id: i2c0 sda: 32 diff --git a/mcu-clock-1.yaml b/mcu-clock-1.yaml index 04e933d..79bf723 100644 --- a/mcu-clock-1.yaml +++ b/mcu-clock-1.yaml @@ -109,11 +109,6 @@ globals: restore_value: no initial_value: "false" -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - display: - platform: tm1637 id: tm1637_display diff --git a/mcu-clock-living-room.yaml b/mcu-clock-living-room.yaml index 2080b17..35a16ec 100644 --- a/mcu-clock-living-room.yaml +++ b/mcu-clock-living-room.yaml @@ -51,11 +51,6 @@ globals: restore_value: no initial_value: "false" -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - binary_sensor: - platform: gpio name: Button diff --git a/mcu-eworkbench.yaml b/mcu-eworkbench.yaml index cae091a..2d526ad 100644 --- a/mcu-eworkbench.yaml +++ b/mcu-eworkbench.yaml @@ -242,11 +242,6 @@ binary_sensor: # on_clockwise: # - display_menu.down: -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - # display: # - platform: tm1637 # id: tm1637_display diff --git a/mcu-fireplace.yaml b/mcu-fireplace.yaml index 4e943ad..a6cdda6 100644 --- a/mcu-fireplace.yaml +++ b/mcu-fireplace.yaml @@ -44,11 +44,6 @@ packages: # Relay1 G22 # Relay2 G19 -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - i2c: # - id: i2c0 # sda: 26 diff --git a/mcu-heater.yaml b/mcu-heater.yaml index 2d6977b..7485244 100644 --- a/mcu-heater.yaml +++ b/mcu-heater.yaml @@ -129,9 +129,7 @@ globals: initial_value: '20.5' time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava + - id: !extend ha_time on_time: - seconds: 0 minutes: /1 diff --git a/mcu-kitchen.yaml b/mcu-kitchen.yaml index abe50fa..beb5356 100644 --- a/mcu-kitchen.yaml +++ b/mcu-kitchen.yaml @@ -55,11 +55,6 @@ api: # Relay1 G22 # Relay2 G19 -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - i2c: # - id: i2c0 # sda: 26 diff --git a/mcu-lvgl.yaml b/mcu-lvgl.yaml index 4b962d4..18b5330 100644 --- a/mcu-lvgl.yaml +++ b/mcu-lvgl.yaml @@ -158,10 +158,6 @@ text_sensor: icon: mdi:clock-start internal: True -time: - - platform: homeassistant - id: time_comp - number: - platform: template initial_value: 0 diff --git a/mcu-m5paper.yaml b/mcu-m5paper.yaml index f1ce4d1..697807e 100644 --- a/mcu-m5paper.yaml +++ b/mcu-m5paper.yaml @@ -26,9 +26,7 @@ packages: common: !include common/common.yaml time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava + - id: !extend ha_time on_time_sync: - bm8563.write_time - platform: bm8563 diff --git a/mcu-mains-power.yaml b/mcu-mains-power.yaml index 5187fc4..6ac0343 100644 --- a/mcu-mains-power.yaml +++ b/mcu-mains-power.yaml @@ -228,9 +228,7 @@ button: - pzemac.reset_energy: pzemac_l3 time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava + - id: !extend ha_time on_time: - cron: '0 0 0 * * *' then: diff --git a/mcu-nspanel-bedroom.yaml b/mcu-nspanel-bedroom.yaml index 4814f7f..950758b 100644 --- a/mcu-nspanel-bedroom.yaml +++ b/mcu-nspanel-bedroom.yaml @@ -136,9 +136,7 @@ nspanel_lovelace: thermo_entity_id: climate.bt_trv_bedroom time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava + - id: !extend ha_time on_time_sync: - script.execute: apply_sleep_dim diff --git a/mcu-nspanel-dev.yaml b/mcu-nspanel-dev.yaml index bbad252..b5db070 100644 --- a/mcu-nspanel-dev.yaml +++ b/mcu-nspanel-dev.yaml @@ -540,11 +540,6 @@ sensor: - platform: template id: room_temperature_id -time: - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - text_sensor: - platform: homeassistant id: name_day diff --git a/mcu-nspanel-fireplace.yaml b/mcu-nspanel-fireplace.yaml index 139643a..8693faf 100644 --- a/mcu-nspanel-fireplace.yaml +++ b/mcu-nspanel-fireplace.yaml @@ -185,11 +185,6 @@ nspanel_lovelace: - name: Auto-zatváranie entity_id: switch.gate_auto_close -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - binary_sensor: - platform: gpio name: Left Button diff --git a/mcu-nspanel-office-j.yaml b/mcu-nspanel-office-j.yaml index 31e465b..3e76d17 100644 --- a/mcu-nspanel-office-j.yaml +++ b/mcu-nspanel-office-j.yaml @@ -134,11 +134,6 @@ nspanel_lovelace: - name: Auto-zatváranie entity_id: switch.gate_auto_close -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - binary_sensor: - platform: gpio name: Left Button diff --git a/mcu-nspanel-office-r.yaml b/mcu-nspanel-office-r.yaml index 99b71c0..f71c83a 100644 --- a/mcu-nspanel-office-r.yaml +++ b/mcu-nspanel-office-r.yaml @@ -158,11 +158,6 @@ nspanel_lovelace: - name: Auto-zatváranie entity_id: switch.gate_auto_close -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - binary_sensor: - platform: gpio name: Left Button diff --git a/mcu-nspanel-patio.yaml b/mcu-nspanel-patio.yaml index 5f5f959..893e3df 100644 --- a/mcu-nspanel-patio.yaml +++ b/mcu-nspanel-patio.yaml @@ -214,11 +214,6 @@ nspanel_lovelace: - name: Rast trávy entity_id: automation.irrigation_grow_grass -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - binary_sensor: - platform: gpio name: Left Button diff --git a/mcu-patio.yaml b/mcu-patio.yaml index c08d8b8..37b5a1b 100644 --- a/mcu-patio.yaml +++ b/mcu-patio.yaml @@ -54,11 +54,6 @@ packages: # Relay1 G22 # Relay2 G19 -time: - - platform: homeassistant - id: ha_time - timezone: Europe/Bratislava - i2c: # - id: i2c0 # sda: 26 diff --git a/mcu-pow-dishwasher.yaml b/mcu-pow-dishwasher.yaml index 121598d..c390eed 100644 --- a/mcu-pow-dishwasher.yaml +++ b/mcu-pow-dishwasher.yaml @@ -187,5 +187,3 @@ switch: - switch.turn_off: relay_off # bi-stable relay so no need to keep on interlock: [relay_on] -time: - - !include common/time/homeassistant.yaml diff --git a/mcu-pow-washer.yaml b/mcu-pow-washer.yaml index 8b4f603..54bfc80 100644 --- a/mcu-pow-washer.yaml +++ b/mcu-pow-washer.yaml @@ -2,7 +2,7 @@ substitutions: device: pow-washer name: Washer POW - comment: + comment: "spare" area: Washroom update_interval: 10s @@ -186,6 +186,3 @@ switch: - delay: 500ms - switch.turn_off: relay_off # bi-stable relay so no need to keep on interlock: [relay_on] - -time: - - !include common/time/homeassistant.yaml diff --git a/mcu-shed.yaml b/mcu-shed.yaml index b04b1d7..f3f5168 100644 --- a/mcu-shed.yaml +++ b/mcu-shed.yaml @@ -109,5 +109,3 @@ switch: number: 19 mode: OUTPUT -time: - - !include common/time/homeassistant.yaml diff --git a/mcu-socket-01.yaml b/mcu-socket-01.yaml index c6966d3..c4ad73c 100644 --- a/mcu-socket-01.yaml +++ b/mcu-socket-01.yaml @@ -121,8 +121,7 @@ switch: # number: GPIO00 # inverted: True -time: - - !include common/time/homeassistant.yaml +# time: # - platform: homeassistant # timezone: Europe/Bratislava # on_time: diff --git a/mcu-socket-02.yaml b/mcu-socket-02.yaml index 026885f..1e6bf6e 100644 --- a/mcu-socket-02.yaml +++ b/mcu-socket-02.yaml @@ -122,8 +122,7 @@ switch: on_turn_off: - light.turn_off: light_red -time: - - !include common/time/homeassistant.yaml +# time: # - platform: homeassistant # timezone: Europe/Bratislava # on_time: diff --git a/mcu-socket-03.yaml b/mcu-socket-03.yaml index 0cd51ea..e6cca52 100644 --- a/mcu-socket-03.yaml +++ b/mcu-socket-03.yaml @@ -144,8 +144,7 @@ switch: # number: GPIO00 # inverted: True -time: - - !include common/time/homeassistant.yaml +# time: # - platform: homeassistant # timezone: Europe/Bratislava # on_time: diff --git a/mcu-stackchan.yaml b/mcu-stackchan.yaml index fce1f4f..10139e3 100644 --- a/mcu-stackchan.yaml +++ b/mcu-stackchan.yaml @@ -883,4 +883,3 @@ time: id: rtc_time i2c_id: i2c_bsp update_interval: never - - !include common/time/homeassistant.yaml \ No newline at end of file diff --git a/mcu-well.yaml b/mcu-well.yaml index cf9927e..ae7daa6 100644 --- a/mcu-well.yaml +++ b/mcu-well.yaml @@ -358,5 +358,3 @@ valve: close_action: - switch.turn_off: irrigation_relay_8 -time: - - !include common/time/homeassistant.yaml