Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax changed in Home assistant - #43

Open
hary260319 opened this issue Nov 4, 2023 · 5 comments
Open

Syntax changed in Home assistant - #43

hary260319 opened this issue Nov 4, 2023 · 5 comments

Comments

@hary260319
Copy link

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... ;-)

@pilotak
Copy link
Owner

pilotak commented Nov 4, 2023

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?

@hary260319
Copy link
Author

hary260319 commented Nov 5, 2023 via email

@pilotak
Copy link
Owner

pilotak commented Nov 5, 2023

at least i tried....

@jceloria
Copy link

I don't use it anymore so i'm kind of missing the need for this integration.

What do you use to track batteries?

@pilotak
Copy link
Owner

pilotak commented Dec 13, 2024

i now only use devices that have battery as separate sensor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants