My old dashboard worked as before. Use these entities:
switch.d_nvr
switch.d_danmain
Both appear on my custom outlet/switch dashboard I made and the on/off calls are working. I have them appear in my dashboard by just adding these two entities above. Hope that helps.!
Just chipping in with what worked for me - and thanks for the tips here, which helped me get this far.
I got this warning after upgrading to 2023.6.0
Command Line YAML configuration has moved. This stops working in version 2023.8.0. Please address before upgrading. Configuring Command Line binary_sensor using YAML has moved. Consult the documentation to move your YAML configuration to integration key and restart Home Assistant to fix this issue.
I use include files in my configuration.yaml - and the culprit was in my binary_sensor.yaml which looked like this:
- platform: command_line
name: OctoPrint camera status
device_class: connectivity
command: >
response=$(curl -LIk -m 5 http://octopi.local/webcam/ -o /dev/null -w
"%{http_code}\n" -s); test "$response" -eq 400 && echo "ON" || echo "OFF"
scan_interval: 60
value_template: '{{ value }}'
I removed that entry from the file and added this line to my configuration.yaml:
command_line: !include command_line.yaml
In command_line.yaml I added the following:
- binary_sensor:
name: OctoPrint camera status
device_class: connectivity
command: >
response=$(curl -LIk -m 5 http://octopi.local/webcam/ -o /dev/null -w
"%{http_code}\n" -s); test "$response" -eq 400 && echo "ON" || echo "OFF"
scan_interval: 60
value_template: '{{ value }}'
Rebooted and the warning disappeared. Hope that helps someone
I am trying to fix these sensors but was not able.
I get duplicate entry error when moving the command line sensor from sensor.yaml to command_line.yaml, and not able to move the btc_price template sensor to template.yaml without getting any errors.
I would appreciate any help. Thanks in advance.
#############################
# CoinMarketCap Integration #
#############################
- platform: command_line
name: coinmarketcap_curl
command: 'curl -X GET -H "X-CMC_PRO_API_KEY: my_api_key" -H "Accept: application/json" -d "symbol=BTC,ADA,BNB,LTC,THETA,DOGE,BAKE,DOT&convert=USD" -G "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest"'
value_template: '{{ value_json.value }}'
scan_interval: 900 #15 mins refresh (at 300 with 3 coins it will use 288 credits per day out of the allocated 333 credits)
json_attributes:
- data
- platform: template
sensors:
btc_price:
unique_id: 'btc_price'
friendly_name: 'Bitcoin Price'
unit_of_measurement: 'USD'
value_template: '{{ ((states.sensor.coinmarketcap_curl.attributes.data.BTC.quote.USD.price) | float) | round(5) }}'
My problem is that I cannot call switch turn on service for this reconfigured switch, because I cannot reference the switch itself (not even in developer call service, not as a device, nor as an entitiy, and I don’t even see in the state list (not by name or unique_id), also not visible under Devices/entites list…
How can I call turn_on service for a command_line defined switch??
Trying to call turn on service in developer tools, command_line switch is not found:
I think you need to get rid of the ‘command_line:’ at the top. It already knows it’s a command_line when you included the command_line yaml file. This is what happened to me. Hope it maybe helps.
Hello everyone!
At the moment I have managed to make the rest of the sensors work for me with the new method
The problem comes to me with the systemmonitor integration, since it falls under sensor.
As:
Hm, if I’m not mistaken, that’s not the case unfortunately, at least according to my previous experiences: the file name could be anything, the content matters. I splitted my configuration in to different yamls, and call them with “include dir” in main configuration yaml, but it doesn’t look at the filename, rather the content.
if I don define command_line at the beginning of the file, I get the following error upon yaml config validation in developer tools:
expected a dictionary for dictionary value @ data['packages']['command_line']
But you gave me a good idea, to try out the command_line integration in the main configuration, maybe it works there.
hm, you also do not declare command_line at the beginning of your split configuration in your separate command_line.yaml as @mchome suggested?? And it works? Tried, but didn’t work for me…
hm, @mchome, just a feedback: I moved the whole thing back to main configuration.yaml, and this way it works perfectly. I don’t know what I’m screwing up with split config, in a different yaml:
Hey,
Can you post it here so I can compare it with mine. I am having the exact issue with my sensors and I keep getting an error after I made the proper changes.
I have my command line sensors moved into a new command_line.yaml file and the sensors are working as normal in the new config. I have renamed the original file to name.yaml.disabled so HA won’t be looking for it. After a reboot the sensors are working but the repair warning is still present. Should it go away on its own if everything is good or do I just have to dismiss it?
Cannot check it myself at the moment (so cannot be sure for 100%), but I do recall that this “Repair” popup has a button after pressing which it is considered that you SOLVED the issue (“repaired”) and this repair entry will disappear.
Have you noticed any problems with the command_line sensor scan_interval?
After moving it to the new format it doesn’t seem to work for me. The script is working correctly once (i.e. after HA restart), but never triggered again.
Here is my config:
configuration.yaml
command_line: !include command_line.yaml
command_line.yaml
- sensor:
name: "Bin collections"
command: "python3 -u /config/python-scripts/bins_collection.py"
scan_interval: 10800 # 3h
command_timeout: 60 # needed as the website may sometimes not load
json_attributes:
- error
- response
Forgot to mention that I use a Docker version of HA