Hello all,
I’m trying to create automation that sends notification if a temperature goes above or below a certain threshold. Those threshold limits are set with Number Helpers using an Entities Card.
My automation failed to save with the error: Message malformed: expected float for dictionary value @ data['above']
How is this done?
The Automation (gives the error above when I try to save it)
alias: Temperature outside limits
description: Send notification to all if temp. is out of limits
mode: single
trigger:
- type: temperature
platform: device
device_id: 1d1df34b60806385eb674a2c129394f5
entity_id: sensor.lumi_lumi_weather_temperature
domain: sensor
above: input_number.temp_hall_high
below: input_number.hiti_hall_low
action:
- service: notify.all_user_devices
data:
title: Temperature outside limits
message: The thermometer reads {{ trigger.event.data }}. The limit is {{ trigger.below }} - {{ trigger.above }}.
You need use two trigger. One trigger for above and another for below. Now, your trigger only fire when the value is above that temp_hall_high AND below that hit_hall_low.
You are of course right @MiguelAngelLV. I hadn’t start to debug because I could not save the automation at all. Turns out that this kind of trigger doesn’t support Helper entity.
Could you please tell me why device triggers, conditions and actions are terrible. Are they buggy, with limted features, or hard to understand? Regarding actions, I still need those with numeric_state triggers, don’t I ?
Device triggers and conditions are aimed at beginners, so they are easier, at first. However as soon as you start trying to do more advanced things like use helpers or templates they don’t work and people wonder why. It’s because device triggers and conditions don’t support this sort of advanced use.
As well as that, if you ever have to replace a device because it breaks, or is lost or stolen, then you have to change the device id everywhere the old one was used, in all triggers, conditions and actions. As there is no option to change the device id of the new device.
If you use triggers, conditions and services that only require an entity_id (like state or numeric_state) then this entity id can be changed in one place to match the old one and all your automations and scripts keep working.
Yes you do. You are using a service call. That’s good. It only requires entity ids. Device actions require device ids, which is bad if you ever have to replace it, as outlined above.
Very well explained, @tom_l. I did use Home Assistant back in 2018 and am revisiting the project now. It is amazing how it has evolved and matured in this time - mostly very well. However, there are some things that seem a bit to complicated and the options to many, like in this case. I guess it’s very hard to manage a large open source project without falling into the trap of adding too many types and options. The hard part is to clean it up afterwards when tons of people are already using all features.