tom_l
October 10, 2023, 12:56am
84
That was a joke.
The only way the “hints” could be less obvious is if they were surrounded by pink boxes, or perhaps use flashing text.
I also agreed that it would be better with a link to the docs concerned.
So what exactly is your issue with the post?
Brizzo89
(Brizzo89)
November 5, 2023, 9:26pm
85
the solution is precisely this, you need to move everything under ‘command_line:’
the old formalism with ‘- platform: command_line’ is no longer valid
MarcoWrt
(Marco)
November 21, 2023, 10:00am
86
Hi all,
Very new to home assistant, super excited about the product, and glad I got it to work the way I wanted to… until I suddenly got the “Command line sensor YAML” warning message … I read the documentation, but I dont understand how to change what I have to what I need. Would anyone be able to point me in the right direction? THANK YOU so much in advance for your support - Marco
this is what i have in my configuration.yaml file that I think is causing the warning
sensor:
- platform: command_line
command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat=50&lon=5®ion=nl&unit=mm%2Fu&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":'+dataRequest+'}'; print(data);"
name: Neerslag_Buienalarm_Regen_Data
json_attributes:
- data
value_template: 'last_changed: {{states.sensor.neerslag_buienalarm_regen_data.last_changed | default(now())}}'
scan_interval: 240
- platform: command_line
command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat=50&lon=5&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}'; print(data);"
name: Neerslag_Buienradar_Regen_Data
json_attributes:
- data
value_template: 'last_changed: {{states.sensor.neerslag_buienradar_regen_data.last_changed | default(now())}}'
scan_interval: 240
SaltyBart
(SaltyBart)
December 7, 2023, 5:05pm
87
Hi guys, after the update my sensors are gone
I don’t see breaking changes, but somehow its not working anymore.
Are there people whit the same issue?
sensor:
- platform: command_line
name: NUC Motherboard Temperature
command: "cat /sys/devices/virtual/thermal/thermal_zone0/temp"
value_template: '{{ value | multiply(0.001) | round(2) }}'
unit_of_measurement: '°C'
- platform: command_line
name: NUC CPU Temperature
command: "cat /sys/devices/virtual/thermal/thermal_zone1/temp"
value_template: '{{ value | multiply(0.001) | round(2) }}'
unit_of_measurement: '°C'
- platform: command_line
name: NUC WiFi Temperature
command: "cat /sys/devices/virtual/thermal/thermal_zone2/temp"
value_template: '{{ value | multiply(0.001) | round(2) }}'
unit_of_measurement: '°C'
LinkX
(Ricardo Fidalgo)
December 7, 2023, 9:37pm
88
Same here
Not find solution yet
posixx
(Posixx)
December 9, 2023, 1:22pm
89
1 Like
SaltyBart
(SaltyBart)
December 17, 2023, 12:05am
90
Thanks a lot, this was the issue!
Niek9182
(Niek9182)
February 15, 2024, 7:07pm
91
I have text below in configuration.yalm.
What do i need to change?
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
binary_sensor: !include binary_sensor.yaml
device_tracker: !include device_tracker.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
ssdp:
sensor:
- platform: template
sensors:
brightness_sun:
friendly_name: "Sunshine"
value_template: >-
{% if state_attr('Sun.sun', 'elevation') > 20 %}
bright
{% elif state_attr('Sun.sun', 'elevation') > 9 %}
mid
{% elif state_attr('Sun.sun', 'elevation') > -3 %}
dark
{% else %}
black
{% endif %}
homeassistant:
packages: !include_dir_named packages/
logger:
default: info
logs:
custom_components.spotcast: debug
gjohansson
(G Johansson)
February 16, 2024, 12:39pm
92
Nothing. I suppose the relevant YAML you might need to change is in one of the yaml files in the packages
folder
elifqaoui
(Elifqaoui)
April 3, 2024, 6:15pm
93
Hi,
i’m struggling with this update command_line. i made the modification but i still have a error.
Below my Code:
in Configuration.Yaml, I add:
command_line: !include command_line.yaml
in commande_line.yaml File : i put the following code:
# OPTIONAL CPU Raspberry Pi Temp
command_line:
- sensor:
name: CPU Temperature
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
value_template: "{{ value | multiply(0.001) | round(2) }}"
I’m still getting the following error when configuration checked
Invalid config for [command_line]: [command_line] is an invalid option for [command_line]. Check: command_line->command_line->0->command_line. (See /config/configuration.yaml, line 18).
what did i miss in the new code?? Thanks for help
Remove “command_line:” from command_line.yaml
Seems like I am the only one that cannot get this to work.
My configuration.yaml
file:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
extra_module_url:
- /hacsfiles/hass-hue-icons/hass-hue-icons.js
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
command_line: !include command_line.yaml
pyscript:
allow_all_imports: true
hass_is_global: true
switch:
- platform: broadlink
mac: !secret macbroadlink
My command_line.yaml
file:
- binary_sensor:
name: "Mosquitto Broker Addon Status"
unique_id: mosquittobroker_addon_status
device_class: connectivity
command: 'ha addons info core_mosquitto | grep -q "started" && (echo "Running") || (echo "Not running")'
payload_on: "Running"
payload_off: "Not running"
- binary_sensor:
name: "Node-RED Addon Status"
unique_id: nodered_addon_status
device_class: connectivity
command: 'ha addons info a0d7b954_nodered | grep -q "started" && (echo "Running") || (echo "Not running")'
payload_on: "Running"
payload_off: "Not running"
My entity (it’s happening with both of them tho):
No way it’s showing as Running. This is what I am getting from terminal:
Can someone help me please?