2023.6: Network storage, favorite light colors, new integrations dashboard

I managed to create several command_line sensors - but they are only updated after HA reboot.
(btw, there is a very old issue with weird templates inside the sensor, it is still here)

I tried it in beta, didn’t try a reload either

Please do not apologize, this is a joint work.

4 Likes

second that… no apologies

2 Likes

third that… no apologies

I agree, I opened PRs to add the location yesterday, but it has not yet been included.

Many of us did, but we all probably just swapped our existing sensors over and they just worked. I.e. no reason for a reload. Only time I reload is when I am building something new and it doesn’t work and I have to fix it. I also don’t reload when the integration does not have unique_id because that’s how you end up with double entities.

1 Like

And here GREAT news:
Finally - show “entity_id” in Dev tools → set state.
image

2 Likes

What if you use sensors.yaml?

About the first problem, I think that you have your backup in HA but you are not seeing it because it has the name you gave to the backup and not the xyz.tar that you see on the network disk.
I think that adding a field to the Backup page with the indication of “where” is located the backup would be a useful addition.
Now, I think I have a good news for you.
If you rename your xyz.tar to something more meaningful you will still be able to do a restore using the “upload backup” function.
This is nothing new as it was working the same way before.
The good news is that even if you change the name to the tar file in the NAS, HA will still see it and give you the possibility to restore it.
Hope this helps

That’s a change in HA. The have to be in command_line now.

command_line.yaml makes sense. Thank you sir!

Only little confusing. Because in ‘command_line’ you must use this way:

- sensor:
    name: CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) | round(1)  }}'

- sensor:        
    name: CPU Speed
    command: "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
    unit_of_measurement: " Mhz"
    value_template: '{{ value | multiply(0.001) | round(0) }}'
    scan_interval: 10

But when you have templates you use this way:

- sensor:
    - name: "Day of the Week"
      state: "{{ now().strftime('%A') }}"
      
    - name: "count_zwave_devices"
      unique_id: "ca89c865-8bc2-4524-8ec2-264f6a391a3b"
      icon: mdi:z-wave
      state: >-
        {% set total = states|selectattr('object_id', 'search', 'node_status')|list|count %}
        {% set dead = states|selectattr('object_id', 'search', 'node_status')|selectattr('state', 'in', 'dead, unavailable, unknown') | list | count %}
        {{ total - dead }} Alive of {{ total }} Total

Maybe in new updates of HA everything will become same way.

4 Likes

How should you use command_line switches in this new format ?
i have couple lights over rfx and its connected to my old domotics, I have no way to move usb rfx transmitter to my HA server. so I have commandl_line switches in switches.yaml :

- platform: command_line
  switch:
    name: light:_11
    command_on: 'curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On"'
    command_off: 'curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=Off"'

I moved to configuration.yaml tested almost every way but doesnt work

command_line:
  - switch:
    name: light_11
    command_on: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On"'
    command_off: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=Off"'
  

this is closest, file editor shows green but check configuration:

Invalid config for [command_line]: expected a dictionary for dictionary value @ data['command_line'][0]['switch']. Got None
extra keys not allowed @ data['command_line'][0]['command_off']. Got '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=Off"'
extra keys not allowed @ data['command_line'][0]['command_on']. Got '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On"'
extra keys not allowed @ data['command_line'][0]['name']. Got 'light_11'. (See /config/configuration.yaml, line 150). 

Yes same here. Also see this on issue report on the Github HA Core VLC report : main decoder error: failed to create audio output ¡ Issue #94154 ¡ home-assistant/core ¡ GitHub

- switch:
    name: light_11
    command_on: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On"'
    command_off: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=Off"'

When I try it in my command_line this give me no errors
You need to have 2 spaced before name etc

1 Like

After the update to version 2023.6 I have a problem: No restart possible. I have an entry webostv with 1 connected device - it works after the update but when I want to do a HA restart then I get the error message

“error restarting home assistant
‘webostv’”

When I want to check the configuration via the developer tools, it just goes round and round forever.
Should I deactivate webostv and shut down HA or do I risk that nothing works anymore?

Regards, Eckart

Thanks! I am pretty sure that I tested that format. so now its working in configuration.yaml
(I wont even test in switch.yaml anymore)

command_line:
  - switch:
      name: light_11
      command_on: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On"'
      command_off: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=Off"'
  

multiple lights it must put this way

command_line:
  - switch:
      name: light_11
      command_on: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=On"'
      command_off: '/usr/bin/curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=27&switchcmd=Off"'
  - switch:
      name: light_12
      command_on: 'curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=13&switchcmd=On"'
      command_off: 'curl "http://192.168.1.6:8080/json.htm?type=command&param=switchlight&idx=13&switchcmd=Off"'
2 Likes

Same question here. I would like to be able to point my DeepStack save_file_folder: to a Share.
I have tried several iterations without luck.

Imho this is a kind of inconsistency.
First wanted to report about it on Github, but this is not a bug; and there is no a Discussion section for a Core.