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
I just confirmed that the scan_interval on my newly-configured command_line sensors is working as expected. That said, I don’t see anything wrong with your YAML. Maybe someone with sharper eyes than I will chime in.
Thx @CaptTom for checking.
I have figured that out. As my sensor didn’t have any state assigned, the default value assigned by HA was ‘unknow’. I think there were some changes around that as it was working fine in version 2023.5. In 2023.6.1 I had to set the state different than ‘uknown’ and scan_interval works fine.
So the correct code would be like that:
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
command_timeout: 60
value_template: '{{ value_json.response }}' # HAD TO ADD THIS TO WORK
json_attributes:
- error
- response
=( I don’t have the knowledge to translate my old lines to the new format, it seems always wrong. I will try again in futuro or totaly discard the switch
I have moved some of my entries over, but I’m lost with the following where I use a combination of WoL and media_player to turn my TV on and off. I cannot for the life of me see what I need to change here!