Hello,
Little backstory. I have connected my Inkbird BBQ temperature meter through MQTT.
Now I tried to create a automation which will let me set a temperature via a input field, and then compare the current temperature and if equal or higher then it will for e.g turn on a light.
Now I’ve ran into the following issue, if the temperature meter is off, it says unknown but somehow this does not work as a condition in my automation:
My condition for checking state:
- condition: template
value_template: '{% if is_state(''sensor.inkbird_bbq_probe_1'', ''unknown'') -%}
{{ False }} {% else %} {{ True }} {% endif %}'
My condition for the temperature (works as far as i know):
- condition: template
value_template: '{{ state_attr(''sensor.inkbird_bbq_probe_1'', ''temperature'')
| float >= states(''input_number.temperature_bbq_probe1'') | float }}'
If I try this in Developer tools → template. It will return false. But when I put this in a automation it will always go to the action trigger (turn on light).
If tried several things, also with states, is_state, etc. Not working.
What am I missing here?
My full automation:
- id: '1619724184688'
alias: Temperature probe 1 max
description: ''
trigger:
- platform: time_pattern
seconds: /5
condition:
- condition: template
value_template: '{% if is_state(''sensor.inkbird_bbq_probe_1'', ''unknown'') -%}
{{ False }} {% else %} {{ True }} {% endif %}'
- condition: template
value_template: '{{ state_attr(''sensor.inkbird_bbq_probe_1'', ''temperature'')
| float >= states(''input_number.temperature_bbq_probe1'') | float }}'
action:
- type: turn_on
device_id: bddee0c6664ee7991f92b574c107623a
entity_id: light.buiten_tafel
domain: light
mode: single