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

Can't create second station switch in config.yaml #307

Open
Harrisdamon opened this issue Aug 27, 2024 · 0 comments
Open

Can't create second station switch in config.yaml #307

Harrisdamon opened this issue Aug 27, 2024 · 0 comments

Comments

@Harrisdamon
Copy link

Harrisdamon commented Aug 27, 2024

I can add the first (s01) station switch using the following code with-out issues, I can also change all the s01's in the code to s02's and it will turn on s02 on my system. I just can't seem to replicate the code to create all 8 station inputs. Any help in what the consecutive code would look like? Quite new at this.

switch:

  • platform: template
    switches:
    harris_irrigation_zone_1:
    value_template: "{{ is_state('binary_sensor.s01_station_running', 'on') }}"
    turn_on:
    service: opensprinkler.run
    data_template:
    entity_id: binary_sensor.s01_station_running
    # Run seconds uses the input_number below.
    run_seconds: "{{ ((states('input_number.s01_station_minutes') | float) * 60) | int }}"
    turn_off:
    service: opensprinkler.stop
    data:
    entity_id: binary_sensor.s01_station_running

input_number:
s01_station_minutes:
initial: 1
min: 1
max: 10
step: 1

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

1 participant