I have a Home Assistant Text Sensor that is (for testing) getting the state of a Shelly and it is working as expected.
text_sensor:
- platform: homeassistant
name: "Test Text Sensor From Home Assistant"
entity_id: switch.shelly1pm_e868e7860768
id: test_state2
[14:29:29][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'Test Text Sensor From Home Assistant'
[14:29:29][C][homeassistant.text_sensor:024]: Entity ID: 'switch.shelly1pm_e868e7860768'
[14:29:36][D][homeassistant.text_sensor:017]: 'switch.shelly1pm_e868e7860768': Got state 'on'
[14:29:36][D][text_sensor:064]: 'Test Text Sensor From Home Assistant': Sending state 'on'
[14:29:38][D][homeassistant.text_sensor:017]: 'switch.shelly1pm_e868e7860768': Got state 'off'
[14:29:38][D][text_sensor:064]: 'Test Text Sensor From Home Assistant': Sending state 'off'
I want to use this state to turn on an LED and the docs say I can use all of the options from ‘Text Sensor’ in a ‘Home Assistant Text Sensor’. So a `text_sensor.state Condition’ should do what I want but I am getting an error that can’t work out.
Cannot have two actions in one item. Key 'if' overrides 'condition'!
What I have tried is straight from the Text Sensor docs.
switch:
- platform: gpio
name: "4B1 LED1"
pin: GPIO4
id: led1_4b1
text_sensor:
- platform: homeassistant
name: "Test Text Sensor From Home Assistant"
entity_id: switch.shelly1pm_e868e7860768
id: test_state2
on_value:
then:
- if:
condition:
text_sensor.state:
id: test_state2
state: 'On'
then:
- switch.turn_on: led1_4b1
else:
- switch.turn_off: led1_4b1
Anyone have any idea what I’m doing wrong ??