I’d like to achieve the following. I set a sensor value from a physical KNX switch. Depending on the sensor value I’d like to start a HA scene.
So I thought I will simply have a new HA automation that reacts on the sensor value being on a numeric state between 0 and 255. Depending on the value I’d like to start a different scene.
At the moment I got:
alias: Start HA scene from KNX sensor value
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.knx_to_homeassistant_szene
above: '0'
condition: []
action:
- service: scene.turn_on
mode: single
And now I don’t get how to start different scenes depending on the sensor value in one automation. I don’t like to have different automations for each value.
I’d use a knx_event instead of a sensor entity to trigger it. Then choose based on "{{ trigger.event.data.data == 1 }}" or "{{ trigger.event.data.value == 1 }}" key for value 1 (knx scene 2 if you use DPT 17).
Yes seems right. Except that the automation triggers the scene directly in its action via a choose, not a script.
I’d stick to HAs automation/script/template documentation - there has been lots of changes recently that make things simpler. You won’t find those in old forum posts.