I’m trying to setup an automation to notify me when 2 values are not equal, I have checked the values under developer tools and they are different (35 & 50) so it should run but the automation is not working and I’m not sure why, any help would be greatly appreciated.
Thanks in advance.
alias: ESS SOC differs from ESS input select value
description: ""
trigger:
- platform: time
at: "08:00:00"
condition:
- condition: template
value_template: >-
"{{ states('input_select.victron_ess_minimum_soc') !=
states('sensor.ess_minimum_soc') }}"
action:
- service: notify.mobile_app_paul_s21
data:
message: >-
ESS SOC differs from ESS input select value (select desired value from
drop down)
title: ESS Missmatch
mode: single
I have also tried
alias: ESS SOC differs from ESS input select value
description: ""
trigger:
- platform: time
at: "08:00:00"
condition:
- condition: template
value_template: >-
"{{ states('input_select.victron_ess_minimum_soc')|float !=
states('sensor.ess_minimum_soc')|float }}'
action:
- service: notify.mobile_app_paul_s21
data:
message: >-
ESS SOC differs from ESS input select value (select desired value from
drop down)
title: ESS Missmatch
mode: single
What are the expected values? Numbers or strings? You might have a conversion issue.
Try to see the result of those two select on the tab Templates under Developer tools.
Or if you are expecting numbers, you can try something like this:
When you say “but it didn’t work”, what that means and how are you testing it?
If you are using the automation as it is, it won’t be triggered until 08:00AM, if you are running the automation manually, it will ignore all the conditions anyways…
If you go to the automation in the UI, you will be able to click on “Test” to verify if the conditions are being evaluated correctly.
OK I found the issue, my template had a " at the beginning and a ’ at the end which is why it was failing.
Thanks for your help you got me headed off in the right direction, when I ran my template under developer tools it came back with True and the single quote at the end.