I have created helpers to enter min & max values for setting temperatures to use in automations. Now it seems like I can not use the values from these helpers directly in the above / below fields for a Device trigger setup. Why is that?
If i enter the helper entity in the above or below fields, I get the following error message:
Message malformed: expected float for dictionary value @ data[‘below’]
Anyone can help with this problem?
Helper name: input_number.basement_max I set this to 9.0
Why can’t I just use the input_number.basement_max entity in the “above” field in the Device Trigger directly?
After reading several posts about this same froblem, I tried using a Template trigger instead. After changing this, I did not get any error messages, but the Automation Template trigger do not fire when the Temperature goes above or below the trigger points.
Following trigger is set to turn off heater when temperature in basement > input_number.basement_max
the automation UI is only a limited version of things you can do in yaml and the bottom line answer to that question is that the UI editor doesn’t support using input_numbers in a device trigger.
you can use a template trigger (as you’ve found) or you can use a state trigger where using an input_number is supported in the “below:” field.
from the docs:
Number helpers (input_number entities), number and sensor entities that contain a numeric value, can be used in the above and below thresholds, making the trigger more dynamic, like:
automation:
trigger:
- platform: numeric_state
entity_id: sensor.outside_temperature
# Other entity ids can be specified for above and/or below thresholds
above: sensor.inside_temperature
But I don’t see any reason that the template you have as the current trigger shouldn’t work.
but you need to be aware that the trigger needs to change from false to true before the trigger will fire. if the trigger is already true then it won’t fire until it goes to false then back to true.
As for Device Triggers, generally speaking they are designed to be composed exclusively via the UI. Whatever the UI permits is all that’s permitted. Attempts to modify the Device Trigger’s YAML (adding templates, etc) are unsupported. The same is true for Device Conditions and Device Actions.
EDIT
This is a perfect example of why I shouldn’t post before being completely awake. I appear to have duplicated finity’s advice.
Haha Taras, yeah same comment as finity. But it did the trick so many thanks for the help!! It’s working fine for me when using the Numeric_State trigger. However, very annoying that the input_number cannot be used in the below/above fiels in the Device Tirgger.
Thanks finity! Yes, using the Numeric_State Trigger works! Also like your comment about the true/false condition of the trigger. Hope they will fix it so the input_number will be possible to use in the above/below fields in the Device Trigger. I don’t see any reason why this should not be possible. Best regards.
Thanks Service Xp. Appreciate your help, eben though I did not go down that route. Used the Numeric_State Trigger instead of the Device Trigger. In the Numeric State Trigger, I can use the input_number in the above/below fields. Hopefully they will fix this, so this can be done in the Device Trigger as well. Best regards.
Don’t forget to mark finity’s post with the Solution tag. Only one post can be marked and you, as the topic’s author, can do that.
By marking finity’s post, it will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. It also puts a link below the first post that leads to the Solution post. All of this helps users find answers to similar questions.