migrate template sensors

This commit is contained in:
Bastian Schnorbus
2025-12-16 18:42:25 +01:00
parent 9f0adf2b0e
commit 130c287b77

View File

@@ -93,42 +93,6 @@ homematic:
password: !secret ccu_password
switch:
- platform: template
switches:
ccu_tsm:
value_template: '{{ is_state("binary_sensor.ccu_thunderstorm_mode","on") }}'
turn_on:
service: homematic.set_variable_value
data:
entity_id: homematic.ccu2
name: ThunderstormMode
value: true
turn_off:
service: homematic.set_variable_value
data:
entity_id: homematic.ccu2
name: ThunderstormMode
value: false
run_script_fernsehschauen:
turn_on:
service: script.fernsehschauenstarten
turn_off:
service: script.noop
run_script_streamingstarten:
turn_on:
service: script.streamingstarten
turn_off:
service: script.noop
run_script_musikstreamingstarten:
turn_on:
service: script.musikstreamingstarten
turn_off:
service: script.noop
run_script_radiostarten:
turn_on:
service: script.radiostarten
turn_off:
service: script.noop
- platform: wake_on_lan
mac: !secret mac_vdr
host: !secret host_vdr
@@ -188,6 +152,121 @@ influxdb:
- sensor
template:
- switch:
- turn_on:
- data:
entity_id: homematic.ccu2
name: ThunderstormMode
value: true
action: homematic.set_variable_value
- turn_off:
- data:
entity_id: homematic.ccu2
name: ThunderstormMode
value: false
action: homematic.set_variable_value
default_entity_id: switch.ccu_tsm
state: '{{ is_state("binary_sensor.ccu_thunderstorm_mode","on") }}'
name: ccu_tsm
- switch:
- turn_on:
- action: script.fernsehschauenstarten
- turn_off:
- action: script.noop
default_entity_id: switch.run_script_fernsehschauen
name: run_script_fernsehschauen
- switch:
- turn_on:
- action: script.streamingstarten
- turn_off:
- action: script.noop
default_entity_id: switch.run_script_streamingstarten
name: run_script_streamingstarten
- switch:
- turn_on:
- action: script.musikstreamingstarten
- turn_off:
- action: script.noop
default_entity_id: switch.run_script_musikstreamingstarten
name: run_script_musikstreamingstarten
- switch:
- turn_on:
- action: script.radiostarten
- turn_off:
- action: script.noop
default_entity_id: switch.run_script_radiostarten
name: run_script_radiostarten
- sensor:
- name: ventil_wohnzimmer
unit_of_measurement: '%'
default_entity_id: sensor.ventil_wohnzimmer
state: '{{states.climate.neq1493917.attributes.valve }}'
- sensor:
- name: ventil_kueche
unit_of_measurement: '%'
default_entity_id: sensor.ventil_kueche
state: '{{states.climate.neq0879536.attributes.valve }}'
- sensor:
- name: ventil_schlafzimmer
unit_of_measurement: '%'
default_entity_id: sensor.ventil_schlafzimmer
state: '{{states.climate.neq1412900.attributes.valve }}'
- sensor:
- name: ventil_bad
unit_of_measurement: '%'
default_entity_id: sensor.ventil_bad
state: '{{states.climate.keq1041886.attributes.valve }}'
- sensor:
- name: ventil_kinderzimmer
unit_of_measurement: '%'
default_entity_id: sensor.ventil_kinderzimmer
state: '{{states.climate.neq1411043.attributes.valve }}'
- sensor:
- name: ventil_studio
unit_of_measurement: '%'
default_entity_id: sensor.ventil_studio
state: '{{states.climate.qeq1461341.attributes.valve }}'
- sensor:
- name: ventil_gaestezimmer
unit_of_measurement: '%'
default_entity_id: sensor.ventil_gaestezimmer
state: '{{state_attr(''climate.000a18a99700a0'', ''valve'' )}}'
- sensor:
- default_entity_id: sensor.sun_elevation
state: '{{ states.sun.sun.attributes.elevation }}'
name: sun_elevation
- sensor:
- default_entity_id: sensor.ccu_service_meldungen
name: CCU Servicemeldungen
state: '{{ states.homematic.ccu2.state | int }}'
- sensor:
- name: Wohnzimmer Harmony
default_entity_id: sensor.remote_wohnzimmer_activity
state: '{{ states.remote.harmony_hub_wohnzimmer.attributes.current_activity }}'
- sensor:
- name: Schlafzimmer Harmony
default_entity_id: sensor.remote_schlafzimmer_activity
state: '{{ states.remote.harmony_hub_schlafzimmer.attributes.current_activity }}'
- sensor:
- default_entity_id: sensor.sunset_time
name: Sonnenuntergang
state: '{{ ((as_timestamp(states.sun.sun.attributes.next_setting)) | timestamp_local) [11:16] }}'
- sensor:
- default_entity_id: sensor.sunrise_time
name: Sonnenaufgang
state: '{{ ((as_timestamp(states.sun.sun.attributes.next_rising)) | timestamp_local) [11:16] }}'
- trigger:
- platform: state
entity_id: binary_sensor.motionwohnzimmer_occupancy
@@ -223,6 +302,8 @@ template:
datetime: "{{ daily['weather.heidelberg'].forecast[0].datetime }}"
temperature: "{{ daily['weather.heidelberg'].forecast[0].temperature }}"
input_boolean:
vacation_mode:
name: Vacation
@@ -308,58 +389,6 @@ mqtt:
position_closed: 0
optimistic: false
sensor:
- platform: template
sensors:
# batt_multisensor:
#friendly_name: 'Battery Multisensor'
#value_template: '{{ states.zwave.aeon_labs_zw074_multisensor_gen5.attributes.battery_level }}'
#unit_of_measurement: '%'
ventil_wohnzimmer:
value_template: '{{states.climate.neq1493917.attributes.valve }}'
unit_of_measurement: '%'
ventil_kueche:
value_template: '{{states.climate.neq0879536.attributes.valve }}'
unit_of_measurement: '%'
ventil_schlafzimmer:
value_template: '{{states.climate.neq1412900.attributes.valve }}'
unit_of_measurement: '%'
ventil_bad:
value_template: '{{states.climate.keq1041886.attributes.valve }}'
unit_of_measurement: '%'
ventil_kinderzimmer:
value_template: '{{states.climate.neq1411043.attributes.valve }}'
unit_of_measurement: '%'
ventil_studio:
value_template: '{{states.climate.qeq1461341.attributes.valve }}'
unit_of_measurement: '%'
ventil_gaestezimmer:
value_template: "{{state_attr('climate.000a18a99700a0', 'valve' )}}"
unit_of_measurement: '%'
sun_elevation:
value_template: '{{ states.sun.sun.attributes.elevation }}'
ccu_service_meldungen:
friendly_name: 'CCU Servicemeldungen'
value_template: '{{ states.homematic.ccu2.state | int }}'
remote_wohnzimmer_activity:
value_template: '{{ states.remote.harmony_hub_wohnzimmer.attributes.current_activity }}'
friendly_name: 'Wohnzimmer Harmony'
remote_schlafzimmer_activity:
value_template: '{{ states.remote.harmony_hub_schlafzimmer.attributes.current_activity }}'
friendly_name: 'Schlafzimmer Harmony'
sunset_time:
friendly_name: 'Sonnenuntergang'
value_template: '{{ ((as_timestamp(states.sun.sun.attributes.next_setting)) | timestamp_local) [11:16] }}'
sunrise_time:
friendly_name: 'Sonnenaufgang'
value_template: '{{ ((as_timestamp(states.sun.sun.attributes.next_rising)) | timestamp_local) [11:16] }}'
history:
include:
domains: