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

Help with Code for Button #17

Open
remirr opened this issue Oct 8, 2021 · 0 comments
Open

Help with Code for Button #17

remirr opened this issue Oct 8, 2021 · 0 comments

Comments

@remirr
Copy link

remirr commented Oct 8, 2021

So I added:
momentary:
to my config.yaml

But where do I add the following? Because I added it to a manual card on the lovelace dashboard but it doesn't seem to work. So I have an input select in my Automations.yaml called: input_select.spa_first_blower. Which is linked to the entity called: pool1_channels2_mode in configuration.yaml

So how do I link that to your card?

Where do I put the following and how to I link it to the Entity or the Input_Select, which in addition, which one do I link it to?

In summary: my API to my SPA cycles through states, 'auto' 'on' 'off'. it does not allow me to select one using input select, I actually need to cycle. So I am trying to create a button which allows me to cycle through and shows the current status on the dashboard so that after we finish in the spa we can set it back to 'off'

switch:

platform: momentary
name: Empty House Trigger
mode: on
toggle_for: 5
cancellable: True


I have added the requested info below. The communication is via REST Api with their systems. The problem I am having with the below is that input_select with a drop down does not work because the API does not allow you to select a 'state' it only allows you to cycle through the individual modes - off, on, auto. Ideally I would like to have a button that just sets the state but I am not sure how I would even do that.

So my backup was just to have a button that says "Top Spa Bubbles" and the current state that it is in, so you can press it - check the state and press it again and check the new state.

Thank you for your help!

In my config.yaml I have

spa_first_blower:
name: Top Spa Bubbles
options:

  • "Auto"
  • "On"
  • "Off"
    In my automation.yaml I have:

id: '1628215649697'
alias: Top Spa Bubbles On
description: ''
trigger:
platform: state
entity_id: input_select.spa_first_blower
to: 'on'
condition: []
action:
service: rest_command.poolaction
data:
action_code: 1
device_number: 2
value: 2
delay: 2
service: homeassistant.update_entity
entity_id: sensor.pool1_channels2_mode
mode: single
id: '1628215649696'
alias: Top Spa Bubbles Off
description: ''
trigger:
platform: state
entity_id: input_select.spa_first_blower
to: 'off'
condition: []
action:
service: rest_command.poolaction
data:
action_code: 1
device_number: 2
value: 0
delay: 2
service: homeassistant.update_entity
entity_id: sensor.pool1_channels2_mode
mode: single

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