Pico1965
(Pico1965)
October 3, 2024, 1:07pm
1
Hiii
In this example lambda:
on_value:
- lambda: |-
if (temperature >= 30) {
send notify to HA or Companion App
}
Can ESPHome send a notification DIRECTLY to home assistant or on the App?
If yes… how do I do it?
P.S. I consider creating a sensor in ESPHome to be managed via trigger in HA as a last resort…
Pico1965:
If yes… how do I do it?
# In some trigger
on_...:
# Simple
- homeassistant.action:
action: notify.html5
data:
message: Button was pressed
koying
(Chris B)
October 3, 2024, 2:26pm
3
If you actually mean “send a notification through HA”, see above.
If you measn “send an event to HA”, see
Pico1965
(Pico1965)
October 3, 2024, 3:04pm
4
Thanks for your interest.
I had already seen the page you suggested but I didn’t understand much…
# In some trigger
on_...:
# Simple
- homeassistant.action:
action: notify.html5
data:
message: Button was pressed
in particular… which button was pressed?
What is the relationship between the pressed button and the proposed code?
None, it’s just the message you send when the action is triggered, could also be:
# In some trigger
on_...:
# Simple
- homeassistant.action:
action: notify.html5
data:
message: Some horse shit fell from the sky
1 Like
Pico1965
(Pico1965)
October 3, 2024, 3:38pm
6
OK… since it communicated that a button was pressed…
The question then changes: which action in ESPHome is triggered?
In my lambda, the temperature is over 30°. How can notify me?
Luckily I had an umbrella!!
on_value_range:
- above: 30.0
then:
Pico1965
(Pico1965)
October 3, 2024, 3:53pm
8
Maybe I’m starting to understand…
I have to confess that maybe my very simplified example is not suitable for the cause.
The message must be sent when the variable (which has nothing to do with the measured sensor)
error = 5
But I understand that you can’t send a notification from inside a lambda…
It’s esphome so sure you can do that. For example you could pack the action (notify) into a script and start/execute this from lambda
Pico1965:
Something like this?
LGTM
Post must be at least 10 characters