homeassistant-attributes icon indicating copy to clipboard operation
homeassistant-attributes copied to clipboard

Syntax changed in Home assistant -

Open hary260319 opened this issue 1 year ago • 3 comments

Hello pilotak, Thanks a lot for your compont that extracts the attributes of an entity. I works perfect.

Unfortunately the HA Team decides to change the systax of the command line sensor from:

sensor:
  - platform: command_line
    name: xxxx

to:

 command_line:
  - sensor:
      name: xxxx

Maybe, it is possible to improve your component to ensure it will work with the new syntax in future too. It would be great if we can use your component also in future.

If I understand correctly the new syntax for your component would be:

attribute:
  - sensor:
    friendly_name: xxxx

Best regards, Harald


Please, allow me to tell the background story - Maybe you find it helpful as a different example for using your component:

I use a python script to read the status of my openevse wallbox. The script uses TCP socket and returns different values by printing a JSON formatted string.

{"WS": " Laden ", "T": 17.7 , "CS": 12 , "CA": 10.78 }

# generate Sensor with JSON attributes from JSON data generated with a python file
command_line:
  - sensor:
      name: wbdata
      command: "python3 /config/custom_components/evse_rapi/EVSE_status.py"
      scan_interval: 15
      json_attributes:
        - CA
        - CS
        - T
        - WS
      value_template: "{{ value_json | tojson }}"

This command line sensor reads the output from my python file and makes the attributes visible in HA, together with your component I can generate different sensors out of one execution of the script.

sensor:
# Sensors generated from Wallbox status attributes - Custom component attributes found on HACS
  - platform: attributes
    friendly_name: "Wallbox Temperatur"
    attribute: "T"
    icon: 'mdi:temperature-celsius' 
    unit_of_measurement: "°C"
    entities:
      - sensor.wbdata

  - platform: attributes
    friendly_name: "Wallbox Status"
    attribute: "WS"
    icon: 'mdi:temperature-celsius' 
    entities:
      - sensor.wbdata

  - platform: attributes
    friendly_name: "Ladestrom Vorgabe"
    attribute: "CS"
    icon: 'mdi:temperature-celsius'
    unit_of_measurement: "A"
    entities:
      - sensor.wbdata

  - platform: attributes
    friendly_name: "Ladestrom aktuell"
    attribute: "CA"
    icon: 'mdi:temperature-celsius'
    unit_of_measurement: "A"
    entities:
      - sensor.wbdata

It works perfect and is easy to configure, but it took me some time to find your solution... ;-)

hary260319 avatar Nov 04 '23 01:11 hary260319

Unfortunately the HA Team decides...

well, they do it quite often unfortunately

It will be nice to have it this way, thanks for nice nice preview, even better to make intergrate UI. But I would actually prefer if somebody could take over the project, i don't use it anymore so i'm kind of missing the need for this integration. Or somebody could step in and i can provide him the rights. Maybe you?

pilotak avatar Nov 04 '23 11:11 pilotak

Hello Pavel,

Thanks a lot for the quick response. And also for the work you put into your custom component. I am afraid that my knowledge is not deep enough to manage such a custom component.

best regards, Harald

On Sat, Nov 4, 2023 at 12:48 PM Pavel S @.***> wrote:

Unfortunately the HA Team decides...

well, they do it quite often unfortunately

It will be nice to have it this way, thanks for nice nice preview, even better to make intergrate UI. But I would actually prefer if somebody could take over the project, i don't use it anymore so i'm kind of missing the need for this integration. Or somebody could step in and i can provide him the rights. Maybe you?

— Reply to this email directly, view it on GitHub https://github.com/pilotak/homeassistant-attributes/issues/43#issuecomment-1793421706, or unsubscribe https://github.com/notifications/unsubscribe-auth/A46JCPV7GCVSQQPUEOK2F6LYCYTQ7AVCNFSM6AAAAAA65GARBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGQZDCNZQGY . You are receiving this because you authored the thread.Message ID: @.***>

hary260319 avatar Nov 05 '23 17:11 hary260319

at least i tried....

pilotak avatar Nov 05 '23 18:11 pilotak