CurrentCost data into Home Assistant?

yes I have that:

my configuration.yaml

shell_command: !include shell_commands.yaml
automation: !include_dir_merge_list automations/

and the shell_commands.yaml

shell_command:
  getcurrentcost: python3 /home/homeassistant/.homeassistant/python_scripts/CurrentCost.py

I changed the configuration.yaml:

shell_command: 
  getcurrentcost: /home/homeassistant/.homeassistant/python_scripts/CurrentCost.py

(this is inside the configuration.yaml) and now it shows correctly:

image

If I run it from terminal it works:

or

I’m a bit late to this thread but I wanted to let you know that I had good success receiving currentcost RF signals with a dvb receiver and rtl433. I built a hassio addon that supports this.

3 Likes

If you want to keep it with the ‘include!’, you need to do this:

configuration.yaml:

shell_command: !include shell_commands.yaml

shell_commands.yaml:

  getcurrentcost: python3 /home/homeassistant/.homeassistant/python_scripts/CurrentCost.py

Notice the 2 spaces before getcurrentcost. The section header is already included in the configuration.yaml and it isn’t needed in the shell_commands.yaml file.

it works with that config, but does’t start the python script …

That may be a permissions thing and it’s outside my realm of expertise. You may want to make a new post or search the forums for similar issues.

Thank you Petro for all the help!

1 Like

Here you can see how I integrated it using an script in Python to influxdb, and influxdb sensor: https://www.solutioon.com/consumo-electrico-en-home-assistant-con-current-cost-envir/

If anyone is interested, I’ve created a custom component for CurrentCost: