This commit is contained in:
Georgi Gardev
2025-01-03 18:23:38 +02:00
parent 04a65f1d97
commit dfe2b34773
8 changed files with 39 additions and 28 deletions

View File

@@ -26,7 +26,7 @@ cards:
- input_boolean.heating_enabled
- input_number.radiators_temperature
- climate.living_room_valve
- climate.bedroom_radiator_mode
- climate.bedroom_radiator
- climate.kitchen_radiator_mode
- script.turn_on_all_radiators
- type: divider

View File

@@ -106,7 +106,7 @@
- type: custom:decluttering-card
template: floorplan_state_with_icon
variables:
- entity: climate.bedroom_radiator_mode
- entity: climate.bedroom_radiator
- top: 27%
- left: 81%
- icon: mdi:radiator

View File

@@ -133,7 +133,7 @@ card:
name: "Living room"
- type: custom:button-card
template: [v3_button_radiator, v3_tablet_button]
entity: climate.bedroom_radiator_mode
entity: climate.bedroom_radiator
name: "Bedroom"
- type: custom:button-card
template: [v3_button_radiator, v3_tablet_button]

View File

@@ -140,7 +140,7 @@ card:
name: "Living room"
- type: custom:button-card
template: [v3_button_radiator, v3_tablet_button]
entity: climate.bedroom_radiator_mode
entity: climate.bedroom_radiator
name: "Bedroom"
- type: custom:button-card
template: [v3_button_radiator, v3_tablet_button]

View File

@@ -134,7 +134,7 @@
name: Air Purifier
- type: custom:button-card
template: v3_button_radiator
entity: climate.bedroom_radiator_mode
entity: climate.bedroom_radiator
name: Radiator
- type: horizontal-stack
cards:

View File

@@ -10,27 +10,38 @@ automation:
input:
action_entity: sensor.bedroom_wall_switch_action
click:
- service: light.toggle
- service: light.turn_on
data_template:
entity_id: >-
{% if is_state('input_select.bedroom_mode', 'day') %}
['light.master_bedroom_main', 'light.bedside']
entity_id: light.tradfri_large
brightness: >-
{% set brt_min = 0 %}
{% set brt_max = 254 %}
{% set brt_steps = 5 %}
{% set brt_step = ((brt_max - brt_min) / brt_steps)|round(0, 'floor') %}
{% set brightness = state_attr("light.tradfri_large", 'brightness')|int(0) %}
{% if brightness == 0 %}
{{ 25 }}
{% elif brightness > 230 %}
{{ 0 }}
{% elif brightness %}
{# Increase brightness one step. #}
{{ (brightness + brt_step, brt_max)|min }}
{% else %}
light.bedside
{# Set the brightness to max if light is off. #}
{{ brt_max }}
{% endif %}
brightness_pct: 100
double_click:
- service: scene.turn_on
entity_id: scene.bedroom_ambient_pink
- service: media_player.unjoin
entity_id: media_player.master_bedroom
- service: media_player.play_media
target:
entity_id: media_player.master_bedroom
data_template:
media_content_type: "music"
media_content_id: "{{ states('input_text.bedroom_2_playlist') }}"
# double_click:
# - service: scene.turn_on
# entity_id: scene.bedroom_ambient_pink
# - service: media_player.unjoin
# entity_id: media_player.master_bedroom
# - service: media_player.play_media
# target:
# entity_id: media_player.master_bedroom
# data_template:
# media_content_type: "music"
# media_content_id: "{{ states('input_text.bedroom_2_playlist') }}"
hold:
- service: script.toggle_bedroom_mode
# hold:
# - service: script.toggle_bedroom_mode

View File

@@ -38,7 +38,7 @@ group:
name: "All Radiators"
entities:
- climate.living_room_valve
- climate.bedroom_radiator_mode
- climate.bedroom_radiator
- climate.kitchen_radiator_mode
script:
@@ -61,7 +61,7 @@ script:
temperature: >-
{% if entity_id == 'climate.living_room_valve' %}
{{ states('input_number.living_room_radiator_temperature') | int | default(23) }}
{% elif entity_id == 'climate.bedroom_radiator_mode' %}
{% elif entity_id == 'climate.bedroom_radiator' %}
{{ states('input_number.bedroom_radiator_temperature') | int | default(23) }}
{% elif entity_id == 'climate.kitchen_radiator_mode' %}
{{ states('input_number.kitchen_radiator_temperature') | int | default(23) }}
@@ -98,7 +98,7 @@ script:
entity_id: climate.living_room_valve
- service: script.maybe_turn_radiator_on
data:
entity_id: climate.bedroom_radiator_mode
entity_id: climate.bedroom_radiator
- service: script.maybe_turn_radiator_on
data:
entity_id: climate.kitchen_radiator_mode

View File

@@ -44,7 +44,7 @@ homekit:
- binary_sensor.bedroom_door_contact
- binary_sensor.bedroom_left_window_contact
- binary_sensor.bedroom_right_window_contact
- climate.bedroom_radiator_mode
- climate.bedroom_radiator
- fan.philips_airpurifier
- sensor.bedroom_weather_humidity
- sensor.bedroom_weather_temperature