Getting a state without depending on the relay state

ok i got it to work finally
i based the button on lovelace on the new switch made with the template
and made an automation that triggers by the state of the template switch
2 automations actually
1 trigger by on state, the other trigger by off state
both of which action is to “turn on” the shelly 1 button
thank you!

The template switch code for use with the Shelly 1 set to timed auto off configuration:

  - platform: template
    switches:
      airconstatus:
        unique_id: air-con-proxy-status
        turn_on:
          service: switch.turn_on
          target:
            entity_id: switch.aircon_running
        turn_off:
          service: switch.turn_off
          target:
            entity_id: switch.aircon_stopped

The automation code so the switch template can turn on the Shelly 1 (i.e. as the switch template changes state to off & on, the Shelly is pulsed on each time):


alias: Automation Aircon Proxy status
description: Proxy switch using airconstatus template entity
trigger:
  - platform: state
    entity_id:
      - switch.airconstatus
    to: "on"
  - platform: state
    entity_id:
      - switch.airconstatus
    to: "off"
condition: []
action:
  - service: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.shelly1_air_con
mode: single

Note the switch template just indicates the state from the last push