I have a weird problem trying to turn_on and turn_off input_boolean in an automation.
I tried service input_boolean.toggle, input_boolean.turn_off and input_boolean.turn_on with no success.
My automation are triggered but nothing change with my input_boolean.
First automation :
- id: '1526351456212'
alias: MQTT Sensor Pool Check OFF
trigger:
- entity_id: sensor.pooltemperaturestatus
from: '1'
platform: state
to: '0'
condition: []
action:
- data:
entity_id: input_boolean.mqtt_sensorpooltemperature
service: input_boolean.toggle
second automation
- id: '1526351399623'
alias: MQTT Sensor Pool Check ON
trigger:
- entity_id: sensor.pooltemperaturestatus
from: '0'
platform: state
to: '1'
condition: []
action:
- data:
entity_id: input_boolean.mqtt_sensorpooltemperature
service: input_boolean.toggle
I’d remove the condition line if you’re not using it, make the ordering tidier, put the service entry before the data entry - so something like this:
- id: '1526351399623'
alias: MQTT Sensor Pool Check ON
trigger:
platform: state
entity_id: sensor.pooltemperaturestatus
from: '0'
to: '1'
action:
- service: input_boolean.toggle
data:
entity_id: input_boolean.mqtt_sensorpooltemperature
homeassistant services (like toggle) just turn into another service call of the same type but to the domain of the entity. So, in this case, homeassistant.toggle just results in another service call to input_boolean.toggle anyway. I believe the idea behind having homeassistant services like these is to be able to apply a service to a collection of entities from different domains, e.g.:
Have you tried changing input_boolean.mqtt_sensorpooltemperature directly, e.g., from the Services page (or even the States page) of the frontend?
Although the formatting of you last attempt is still a bit unusual, I think it is technically correct. That’s why I’m wondering about input_boolean.mqtt_sensorpooltemperature itself.
Having said that, you might try adjusting your automation a bit - something like this:
- id: '1526351399623'
alias: MQTT Sensor Pool Check
trigger:
entity_id: sensor.pooltemperaturestatus
platform: state
action:
service: input_boolean.toggle
entity_id: input_boolean.mqtt_sensorpooltemperature
Yup, I tried changing the input_boolean by calling the service from the services page and it work.
That’s why i’m lost why it do not want to work from my automation.
Hmm. Are you sure the automation is getting triggered? Can you open the automation in the frontend? If so you should be able to see when it was last triggered. You can also force a trigger to see if the actions run.
True, i didn’t think about the manual triger.
I just tried, I changed the automation like what you did and then fired manually the automation…nothing change on my input
Will try later to remove everything’s in my automation.yaml, maybe I have something conflicting.
Well to continue my saga, I tried to clean-up my automation.yaml.
This is only what I have :
- id: '1526351399623'
alias: MQTT Sensor Pool Check
trigger:
entity_id: sensor.pooltemperaturestatus
platform: state
action:
service: input_boolean.toggle
entity_id: input_boolean.mqtt_sensorpooltemperature
Still no luck.
I triggered manually my automation several times and nothing change on my input_booelan.
I begin to think that this type of sensor is not for me