diff --git a/config/packages/devices/purifier.yaml b/config/packages/modules/climate/purifier.yaml similarity index 100% rename from config/packages/devices/purifier.yaml rename to config/packages/modules/climate/purifier.yaml diff --git a/config/packages/sensors/weather.yaml b/config/packages/modules/climate/weather.yaml similarity index 100% rename from config/packages/sensors/weather.yaml rename to config/packages/modules/climate/weather.yaml diff --git a/config/packages/sensors/windows.yaml b/config/packages/modules/climate/windows.yaml similarity index 100% rename from config/packages/sensors/windows.yaml rename to config/packages/modules/climate/windows.yaml diff --git a/config/packages/modules/lighting/automations.yaml b/config/packages/modules/lighting/automations.yaml new file mode 100644 index 0000000..59fd002 --- /dev/null +++ b/config/packages/modules/lighting/automations.yaml @@ -0,0 +1,61 @@ + +automation: + - alias: Lighting · Turn on ceiling lights after sunset + trigger: + platform: sun + event: sunset + offset: "-01:00:00" + condition: + - condition: state + entity_id: binary_sensor.georgi_home + state: "on" + action: + - service: light.turn_on + entity_id: light.ceiling_lights + + - alias: Lighting · Turn off all lights after sunrise + trigger: + platform: sun + event: sunrise + offset: "+00:00:00" + action: + - service: light.turn_off + entity_id: light.all_lights + + - alias: Lighting · Master bedroom · Toggle main lights on bedisde switch single click" + trigger: + platform: event + event_type: zha_event + event_data: + device_ieee: !secret master_bedroom_bedside_switch_ieee + command: single + action: + - service: light.toggle + entity_id: light.master_bedroom_main_lights + + - alias: Lighting · Living room · Turn all lights on on Magic Cube flip 90 + trigger: + platform: event + event_type: zha_event + event_data: + device_ieee: !secret magic_cube_ieee + command: flip + args: + flip_degrees: 90 + action: + - service: light.turn_on + entity_id: light.living_room_all_lights + + - alias: Lighting · Living room · Turn all lights off on Magic Cube flip 180 + trigger: + platform: event + event_type: zha_event + event_data: + device_ieee: !secret magic_cube_ieee + command: flip + args: + flip_degrees: 180 + action: + - service: light.turn_off + entity_id: light.living_room_all_lights + diff --git a/config/packages/modules/lighting/connectors.yaml b/config/packages/modules/lighting/connectors.yaml new file mode 100644 index 0000000..79229ea --- /dev/null +++ b/config/packages/modules/lighting/connectors.yaml @@ -0,0 +1,11 @@ +# https://www.home-assistant.io/integrations/yeelight +yeelight: + devices: + !secret yeelight_bedside_ip: + name: Bedside light + +# https://www.home-assistant.io/integrations/tuya +tuya: + username: !secret tuya_username + password: !secret tuya_password + country_code: bg diff --git a/config/packages/modules/lighting/groups.yaml b/config/packages/modules/lighting/groups.yaml new file mode 100644 index 0000000..8b2da61 --- /dev/null +++ b/config/packages/modules/lighting/groups.yaml @@ -0,0 +1,69 @@ +light: + - platform: group + name: Living room main lights + entities: + - light.light_lohas_1 + - light.light_lohas_2 + - light.light_le_9 + - light.light_le_10 + + - platform: group + name: Living room all lights + entities: + - light.living_room_main_lights + - light.pc + + - platform: group + name: Master bedroom main lights + entities: + - light.light_le_1 + - light.light_le_2 + - light.light_le_3 + - light.light_le_4 + + - platform: group + name: Master bedroom all lights + entities: + - light.master_bedroom_main_lights + - light.bedside_light + + - platform: group + name: Kitchen main lights + entities: + - light.light_le_11 + - light.light_le_12 + - light.light_orbecco_1 + + - platform: group + name: Hallway entrance lights + entities: + - light.light_le_5 + - light.light_le_6 + + - platform: group + name: Hallway main lights + entities: + - light.light_le_7 + - light.light_le_8 + + - platform: group + name: Hallway all lights + entities: + - light.hallway_entrance_lights + - light.hallway_main_lights + + - platform: group + name: Ceiling lights + entities: + - light.living_room_all_lights + - light.master_bedroom_main_lights + - light.kitchen_main_lights + - light.hallway_all_lights + + - platform: group + name: All lights + entities: + - light.living_room_all_lights + - light.master_bedroom_all_lights + - light.kitchen_main_lights + - light.hallway_all_lights diff --git a/config/packages/modules/lighting.yaml b/config/packages/modules/lighting/mqtt.yaml similarity index 75% rename from config/packages/modules/lighting.yaml rename to config/packages/modules/lighting/mqtt.yaml index 66db6b5..685c842 100644 --- a/config/packages/modules/lighting.yaml +++ b/config/packages/modules/lighting/mqtt.yaml @@ -1,18 +1,3 @@ -# https://www.home-assistant.io/integrations/light -# https://www.home-assistant.io/integrations/light.group - -# https://www.home-assistant.io/integrations/yeelight -yeelight: - devices: - !secret yeelight_bedside_ip: - name: Bedside light - -# https://www.home-assistant.io/integrations/tuya -tuya: - username: !secret tuya_username - password: !secret tuya_password - country_code: bg - light: - platform: mqtt name: "PC" @@ -179,75 +164,6 @@ light: qos: 1 retain: false - - platform: group - name: Living room main lights - entities: - - light.light_lohas_1 - - light.light_lohas_2 - - light.light_le_9 - - light.light_le_10 - - - platform: group - name: Living room all lights - entities: - - light.living_room_main_lights - - light.pc - - - platform: group - name: Master bedroom main lights - entities: - - light.light_le_1 - - light.light_le_2 - - light.light_le_3 - - light.light_le_4 - - - platform: group - name: Master bedroom all lights - entities: - - light.master_bedroom_main_lights - - light.bedside_light - - - platform: group - name: Kitchen main lights - entities: - - light.light_le_11 - - light.light_le_12 - - light.light_orbecco_1 - - - platform: group - name: Hallway entrance lights - entities: - - light.light_le_5 - - light.light_le_6 - - - platform: group - name: Hallway main lights - entities: - - light.light_le_7 - - light.light_le_8 - - - platform: group - name: Hallway all lights - entities: - - light.hallway_entrance_lights - - light.hallway_main_lights - - - platform: group - name: Ceiling lights - entities: - - light.living_room_all_lights - - light.master_bedroom_main_lights - - light.kitchen_main_lights - - light.hallway_all_lights - - - platform: group - name: All lights - entities: - - light.living_room_all_lights - - light.master_bedroom_all_lights - - light.kitchen_main_lights - - light.hallway_all_lights - sensor: - platform: mqtt name: "PC light WiFi" @@ -398,65 +314,6 @@ switch: value_template: "{{ value_json.Fade }}" automation: - - alias: Lighting · Turn on ceiling lights after sunset - trigger: - platform: sun - event: sunset - offset: "-01:00:00" - condition: - - condition: state - entity_id: binary_sensor.georgi_home - state: "on" - action: - - service: light.turn_on - entity_id: light.ceiling_lights - - - alias: Lighting · Turn off all lights after sunrise - trigger: - platform: sun - event: sunrise - offset: "+00:00:00" - action: - - service: light.turn_off - entity_id: light.all_lights - - - alias: Lighting · Master bedroom · Toggle main lights on bedisde switch single click" - trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_bedside_switch_ieee - command: single - action: - - service: light.toggle - entity_id: light.master_bedroom_main_lights - - - alias: Lighting · Living room · Turn all lights on on Magic Cube flip 90 - trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret magic_cube_ieee - command: flip - args: - flip_degrees: 90 - action: - - service: light.turn_on - entity_id: light.living_room_all_lights - - - alias: Lighting · Living room · Turn all lights off on Magic Cube flip 180 - trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret magic_cube_ieee - command: flip - args: - flip_degrees: 180 - action: - - service: light.turn_off - entity_id: light.living_room_all_lights - - alias: Lighting · Sync Tasmota states on start-up initial_state: true trigger: diff --git a/config/packages/modules/music.yaml b/config/packages/modules/media/music.yaml similarity index 100% rename from config/packages/modules/music.yaml rename to config/packages/modules/media/music.yaml diff --git a/config/packages/devices/tv.yaml b/config/packages/modules/media/tv.yaml similarity index 100% rename from config/packages/devices/tv.yaml rename to config/packages/modules/media/tv.yaml diff --git a/config/packages/modules/youtube.yaml b/config/packages/modules/media/youtube.yaml similarity index 100% rename from config/packages/modules/youtube.yaml rename to config/packages/modules/media/youtube.yaml diff --git a/config/packages/sensors/nas.yaml b/config/packages/modules/network.yaml similarity index 62% rename from config/packages/sensors/nas.yaml rename to config/packages/modules/network.yaml index 5229336..9ae2b8c 100644 --- a/config/packages/sensors/nas.yaml +++ b/config/packages/modules/network.yaml @@ -1,3 +1,26 @@ +fastdotcom: +speedtestdotnet: + +mikrotik: + - name: Mikrotik + host: !secret mikrotik_host + username: !secret mikrotik_username + password: !secret mikrotik_password + +pi_hole: + - host: !secret pihole_host + api_key: !secret pihole_api_key + +switch: + - platform: command_line + switches: + pihole_temp_disable: + friendly_name: "Pi-Hole pause for 5 mins" + command_on: !secret pihole_disable_5 + command_off: !secret pihole_enable + command_state: !secret pihole_status + value_template: '{{ value_json.status == "disabled" }}' + # https://www.home-assistant.io/integrations/synologydsm sensor: - platform: synologydsm diff --git a/config/packages/modules/networking.yaml b/config/packages/modules/networking.yaml deleted file mode 100644 index acb9ac7..0000000 --- a/config/packages/modules/networking.yaml +++ /dev/null @@ -1,22 +0,0 @@ -fastdotcom: -speedtestdotnet: - -mikrotik: - - name: Mikrotik - host: !secret mikrotik_host - username: !secret mikrotik_username - password: !secret mikrotik_password - -pi_hole: - - host: !secret pihole_host - api_key: !secret pihole_api_key - -switch: - - platform: command_line - switches: - pihole_temp_disable: - friendly_name: "Pi-Hole pause for 5 mins" - command_on: !secret pihole_disable_5 - command_off: !secret pihole_enable - command_state: !secret pihole_status - value_template: '{{ value_json.status == "disabled" }}'