Hi all,
i used to use HA, with template in configuration,
now after update all my home-PLC related buttons and sensors are gone, can anyone help with fixing configuration to ‘new type’?
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
scene: !include scenes.yaml
modbus:
- name: modbus_hub
type: tcp
host: 192.168.0.100
port: 502
delay: 0
message_wait_milliseconds: 500
timeout: 1
binary_sensors:
# QX12.0 = 512
- name: "SwTV1_status"
slave: 1
address: 512
input_type: discrete_input
scan_interval: 1
sensor:
- platform: template
sensors:
power_total_used:
unique_id: power_total_used
value_template: >-
{{ (states('sensor.shellyem3_08f9e047b2db_phase_a_power')|float(0) +
states('sensor.shellyem3_08f9e047b2db_phase_b_power')|float(0) +
states('sensor.shellyem3_08f9e047b2db_phase_c_power')|float(0) | round(0))}}
unit_of_measurement: "W"
device_class: power
energy_total_used:
unique_id: energy_total_used
value_template: >-
{{ (states('sensor.shellyem3_08f9e047b2db_phase_a_energy')|float(0)+
states('sensor.shellyem3_08f9e047b2db_phase_b_energy')|float(0) +
states('sensor.shellyem3_08f9e047b2db_phase_c_energy')|float(0))}}
unit_of_measurement: "kWh"
device_class: energy
power_total_produced:
unique_id: power_total_produced
value_template: >-
{{ (states('sensor.l1_moc')|float(0) +
states('sensor.l2_moc')|float(0)|float(0)) | round(0) }}
unit_of_measurement: "W"
device_class: power
energy_total_produced:
unique_id: energy_total_produced
value_template: >-
{{ (states('sensor.opendtu_lukasz_yield_day')|float(0) /
float(1000) | round(0)) }}
unit_of_measurement: "kWh"
device_class: energy
rest_command:
swtv1_off:
url: "http://PLC/WRITEPI?ADR1=MB1&FORMAT1=%25d&VALUE1=0"
swtv1_on:
url: "http://PLC/WRITEPI?ADR1=MB1&FORMAT1=%25d&VALUE1=1"
switch:
- platform: template
switches:
swtv1:
friendly_name: "SwTV1"
value_template: "{{ is_state('binary_sensor.SwTV1_status', 'on') }}"
turn_on:
service: script.swtv1_turn_on
turn_off:
service: script.swtv1_turn_off
script:
swtv1_turn_on:
sequence:
- condition: template
value_template: "{{ is_state('binary_sensor.SwTV1_status', 'off') }}"
- service: rest_command.swtv1_on
- delay: "00:00:01"
- service: rest_command.swtv1_off
swtv1_turn_off:
sequence:
- condition: template
value_template: "{{ is_state('binary_sensor.SwTV1_status', 'on') }}"
- service: rest_command.swtv1_on
- delay: "00:00:01"
- service: rest_command.swtv1_off