Hello all,
First excuse if my english is not perfect, i’m french and some times (due to grammatical differences) it could not be clear
I try for 3 hours to debug my config.yaml because the error message about “command_line” “Configuring Command Line sensor using YAML has moved.”
So please, i need help
The old one (working fine):
- platform: template
sensors:
conso_corrigee:
friendly_name: "conso corrigee"
value_template: "{{states('sensor.shellyem_34945470f4ca_channel_2_power')|multiply(1.06)|round(0)}}"
unit_of_measurement: Wh
device_class: energy
icon_template: mdi:gauge
attribute_templates:
state_class: total_increasing
#comptage lumières allumées
nombre_lumieres_on:
friendly_name: "lumières allumées"
value_template: "{{ states.light | selectattr('state', 'eq', 'on') | rejectattr('attributes.friendly_name','search','all')| list | count }}"
#Solaire beem
solaire_beem_total:
friendly_name: "Solaire Beem Total"
value_template: "{{states('sensor.beem1_ch1_power') | float + states('sensor.beem2_ch1_power') | float}}"
unit_of_measurement: 'watts'
#solaire Voltalia
solaire_voltalia_total:
friendly_name: "Solaire Voltalia Total"
value_template: "{{states('sensor.arriere_cuisine_ch1_power') | float + states('sensor.arriere_salon_ch1_power') | float}}"
unit_of_measurement: 'watts'
#temperature SPA
temperature_spa:
friendly_name: "temperature spa"
value_template: "{{ state_attr('climate.spa', 'current_temperature') }}"
unit_of_measurement: '°C'
#System Monitor raspberry Pi
- platform: systemmonitor
resources:
- type: disk_free
arg: /
- type: disk_use_percent
arg: /
- type: memory_free
- type: memory_use_percent
- type: swap_use_percent
- type: processor_use
- type: last_boot
# Temperature CPU
- platform: command_line
name: "RPi CPU Temperature"
command: "cat /sys/class/thermal/thermal_zone0/temp"
value_template: "{{ value | multiply(0.001) | round(2) }}"
unit_of_measurement: c°
# Tempo
- platform: rest
name: "Tempo Demain"
resource_template: https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{now().strftime("%Y-%m-%d")}}&TypeAlerte=TEMPO
value_template: '{{ value_json.JourJ1.Tempo }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: "Tempo Aujourd'hui"
resource_template: https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{now().strftime("%Y-%m-%d")}}&TypeAlerte=TEMPO
value_template: "{{ value_json['JourJ'].Tempo }}"
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
The new one (f#cked up):
error: configuration is not valid: Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 54).
sensor:
- platform: command_line
name: "conso corrigee"
command: "echo '{{ states(''sensor.shellyem_34945470f4ca_channel_2_power'') | float * 1.06 | round(0) }}'"
unit_of_measurement: Wh
device_class: energy
icon_template: mdi:gauge
scan_interval: 5
- platform: command_line
name: "lumières allumées"
command: "echo '{{ states.light | selectattr(''state'', ''eq'', ''on'') | rejectattr(''attributes.friendly_name'',''search'',''all'') | list | count }}'"
scan_interval: 5
- platform: command_line
name: "Solaire Beem Total"
command: "echo '{{ states(''sensor.beem1_ch1_power'') | float + states(''sensor.beem2_ch1_power'') | float }}'"
unit_of_measurement: 'watts'
scan_interval: 5
- platform: command_line
name: "Solaire Voltalia Total"
command: "echo '{{ states(''sensor.arriere_cuisine_ch1_power'') | float + states(''sensor.arriere_salon_ch1_power'') | float }}'"
unit_of_measurement: 'watts'
scan_interval: 5
- platform: command_line
name: "temperature spa"
command: "echo '{{ state_attr(''climate.spa'', ''current_temperature'') }}'"
unit_of_measurement: '°C'
scan_interval: 60
- platform: command_line
name: "RPi CPU Temperature"
command: "cat /sys/class/thermal/thermal_zone0/temp"
value_template: "{{ value | multiply(0.001) | round(2) }}"
unit_of_measurement: "°C"
- platform: systemmonitor
resources:
- type: disk_free
arg: /
- type: disk_use_percent
arg: /
- type: memory_free
- type: memory_use_percent
- type: swap_use_percent
- type: processor_use
- type: last_boot
- platform: rest
name: "Tempo Demain"
resource_template: "https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{ now().strftime('%Y-%m-%d') }}&TypeAlerte=TEMPO"
value_template: "{{ value_json.JourJ1.Tempo }}"
headers:
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
Content-Type: "application/json"
User-Agent: "Wget/1.20.3 (linux-gnu)"
- platform: rest
name: "Tempo Aujourd'hui"
resource_template: "https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{ now().strftime('%Y-%m-%d') }}&TypeAlerte=TEMPO"
value_template: "{{ value_json['JourJ'].Tempo }}"
headers:
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
Content-Type: "application/json"
User-Agent: "Wget/1.20.3 (linux-gnu)"