#Sync light and switch-indicator states

1 messages · Page 1 of 1 (latest)

rain goblet
#

I want to build a KNX-like system where the wall switch has a light indicator, that can be used to show the state of the light/switch this switch is controlling. In KNX system, this is called the "feedback" feature where the switch indicator light listens to specific group address. This group with state info is sent from the actuator.

Main light/switch and the indicator switch/light entities are available in home assistant for control. There are many of them, so I am looking for an optimized way to have the link between:

  • switch that does to light toggle (control)
  • entity state of the main light/switch to propagate the state to the indicator light/switch entity
  • sync the data when the home assistant turns on

for now I see the only good way with an automation (or many of them) with blueprint. Eventually creating the names of the entities in a way that I can use templates for the output control with something like light.main_light_indicator where light.main_light is the actual light and _indicator is the indicator entity light.

Any better suggestions?

Talking about the switch as on the picture below.

rain goblet
#

I solved it with a blueprint for source and status entities pickup.

blueprint:
  name: Sync status entity with the source entity
  description: >-
    Syncs the status entity to the source entity. The idea is to have a way
    to show status lights in the wall switch based on the main source entity state.

    The source and status entities shall both be available in home assistant
  domain: automation
  input:
    source_entity:
      name: "Source entity"
      description: "Any entity with on/off states. It is used as a source state for the status entity object"
      default: ""
      selector:
        entity:
    status_entity:
      name: "Status entity"
      description: "Status entity that will reflect the state of the source entity"
      selector:
        entity:
          filter:
            - domain: light
            - domain: switch
      default: ""

variables:
  source_entity: !input source_entity

triggers:
  # Home assistant start to sync the states
  - trigger: homeassistant
    event: start

  # The state of the controlled output to sync the indicator output
  - trigger: state
    entity_id: !input source_entity
    id: state-changed

  - trigger: event
    event_type: automation_reloaded
conditions: []
actions:
  # Control the status to the same state as the main entity
  - action: homeassistant.turn_{{ iif(is_state(source_entity, 'on'), 'on', 'off') }}
    target:
      entity_id: !input status_entity
mode: queued
max_exceeded: silent
west zinc
#

The main idea is not to have a proxy-knx-light-entity that has to be synced, but use telegrams and knx expose directly with other-integration light entities.