ill try tommorow the automation one
ok i added the show state… it still gives me the eror
Failed to call service script/sauna_pump_switch_toggle_leds_too. Service not found.
as i already have 3 show states for Switch … but when you click the button its failing
below is the entire button card code
the 3 states i have on off unavaliable are to show the state of h_sauna_pump switch
but when i said i added part of your code
i changed mine
tap_action: toggle
to
tap_action:
action: call-service
service: script.sauna_pump_switch_toggle_leds_too
and it wont run the script
type: horizontal-stack
title: null
size: 10%
cards:
- type: 'custom:button-card'
color_type: card
icon: 'mdi:pump'
name: Sauna Pump<br>Offline
entity: switch.h_sauna_pump
tap_action:
action: call-service
service: script.sauna_pump_switch_toggle_leds_too
show_state: true
styles:
card:
- font-size: 20px
- height: 150px
- width: 145px
- color_type: card
- color: 'rgb(255,255,255)'
state:
- value: 'off'
name: Sauna Pump <br>Off
color: 'rgb(255, 0, 0)'
- value: 'on'
name: Sauna Pump <br>On
color: 'rgb(0, 128, 0)'
- value: unavailable
name: Sauna Pump <br>Offline
color: 'rgb(0, 0, 128)'
and this is my toggle automation script for button on screen
script for website Button card
this is the script yaml
alias: sauna pump switch toggle leds too
sequence:
- service: switch.toggle
target:
entity_id:
- switch.h_sauna_pump
- switch.led_pump_on
- switch.led_pump_off
mode: single
this is the automation yaml for the physicial button
alias: Toggle Switch when Button is pressed
description: ''
trigger:
- platform: state
entity_id: binary_sensor.pump_switch
from: 'off'
to: 'on'
condition: []
action:
- service: switch.toggle
target:
entity_id:
- switch.h_sauna_pump
- switch.led_pump_on
- switch.led_pump_off
- service: script.turn_off
target:
entity_id:
- script.15_min_pump_on
- script.20_min_pump_on
- script.30_min_pump_on
mode: single
so right now it works for PHysical Button with the reverse logic
but home Assistant reads it as OFF but i want HA to read the RED led toggled to the ON position when you boot up home assistant not to the off position is there anyway to force it
for now i had to do reverse logic to get it to come on on boot up but shows up as off
sorry dislexia i dont explain things right.
ill try the automation tommorow