I get this error from Visual Studio code for this row:
service_template: switch.turn_'{{ "off" if brightness == 0 else "on" }}'
String does not match the pattern of “DEPRECATED^”.yaml-schema: http://schemas.home-assistant.io/configuration
- platform: template
lights:
Smart_plug_1:
friendly_name: 'Smart Plug 1'
value_template: '{{ states.switch.525736102462ab171e7c.state }}'
turn_on:
service: switch.turn_on
entity_id: switch.525736102462ab171e7c
turn_off:
service: switch.turn_off
entity_id: switch.525736102462ab171e7c
set_level:
service_template: switch.turn_'{{ "off" if brightness == 0 else "on" }}'
entity_id: switch.525736102462ab171e7c
petro
(Petro)
2
service_template is no longer needed. Also, remove the single quote in front of the template and place it before switch.
service: 'switch.turn_{{ "off" if brightness == 0 else "on" }}'
1 Like
Flo35
(Florent)
4
Hi guys.
Same error for me. Can you help me please ?
sensor:
- platform: template
sensors:
cover_auto_open:
friendly_name: "Ouverture des volets à"
value_template: '{{ (as_timestamp(states.sun.sun.attributes.next_rising) + (states("input_number.cover_day_offset") | int) * 60) | timestamp_custom("%H:%M") }}'
entity_id: [sun.sun, input_number.cover_day_offset]
icon_template: mdi:clock
cover_auto_close:
friendly_name: "Fermeture des volets à"
value_template: '{{ (as_timestamp(states.sun.sun.attributes.next_setting) + (states("input_number.cover_night_offset") | int) * 60) | timestamp_custom("%H:%M") }}'
entity_id: [sun.sun, input_number.cover_night_offset]
icon_template: mdi:clock
The error is for the line with entity_id
Thanks
petro
(Petro)
5
Just delete the entity id line
Flo35
(Florent)
6
Thanks petro.
If i delete those lines will this continue to work ?
I have the same issue but on other lines; can you please help me as well?
- platform: template
sensors:
energy_total:
friendly_name: 'Total Energy'
entity_id:
- sensor.shelly_bv1_power
- sensor.shelly_bv2_power
- sensor.shelly_bv3_power
value_template: "{{ (states('sensor.shelly_bv1_power')|float + states('sensor.shelly_bv2_power')|float + states('sensor.shelly_bv3_power')|float)|round(3) }}"
unit_of_measurement: "W"
rr19-hub
(Rr19 Hub)
11
I get the same error in vscode with my mqtt sensors but can’t find a solution. The MQTT server works, the topics contain values.
sensor.yaml:
petro
(Petro)
12
MQTT platform is being deprecated in 2022.9.
bcrochet
(Brad P Crochet)
13
2 Likes