Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95414

Run Python Script in Automation

$
0
0

@SuperMaximus wrote:

Can’t make the appropriate switch to run in Automation depending on the state of some sensors.
Following examples from Community forum, made below config in configuration.yaml:

  - platform: command_line
    switches:
    intercom:
    swimpool_on: "python3 /config/python_scripts/swimpool1.py"
    swimpool_off: "python3 /config/python_scripts/swimpool2.py"

and getting as a result:

* Invalid config for [notify.command_line]: required key not provided @ data['command']. Got None. (See ?, line ?).
* Invalid config for [sensor.template]: [switches] is an invalid option for [sensor.template]. Check: sensor.template->switches. (See ?, line ?).
* Invalid config for [sensor.command_line]: [switches] is an invalid option for [sensor.command_line]. Check: sensor.command_line->switches. (See ?, line ?).
* Error loading /config/configuration.yaml: mapping values are not allowed here in "/config/configuration.yaml", line 268, column 16
* Invalid config for [switch.command_line]: [name] is an invalid option for [switch.command_line]. Check: switch.command_line->name. (See ?, line ?).

I have python_scripts normally working for sensors from “command_line”, but can’t configure switch properly. What is wrong?

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>