Malaki86
(Dennis McKinney)
November 13, 2023, 5:20pm
1
I have Zigbee devices integrated into HA that i want to incorporate into an ESPHome device. Can anyone point me towards example code to do this?
I need to read the temperature from a TH sensor (br_th), and how to declare and control 2 switches (br_sw1 & br_sw2).
indeeed
November 13, 2023, 6:16pm
2
1 Like
Malaki86
(Dennis McKinney)
November 13, 2023, 6:59pm
3
This looks easy enough.
Now to figure out the HA switches.
Thanks
I might bring all sensors into ha and setup automations inside ha for business logic.
Malaki86
(Dennis McKinney)
November 13, 2023, 8:37pm
5
I’m 99% positive that i found a good example for both reading and controlling HA sensors & switches on this project:
Malaki86
(Dennis McKinney)
November 13, 2023, 10:15pm
6
I was mistaken. I’m still trying to figure out how to define a switch in ESPHome that will control a switch connected to HA via Zigbee.
Again, why don’t you bring sensor data to home assistant as a sensor and solve this problem inside home assistant automation (when x happens, turn on switch)
At worst, you are allowed to execute ha service calls from esp home (switch.turn_on)
Malaki86
(Dennis McKinney)
November 14, 2023, 11:05am
8
Because i was asking HOW to turn an HA-connected switch FROM ESPHome.
it would be great to have a reasoning around it, rather than going with usual way. it might be a valid case when you want esphome to run as a standalone tool, but I want it because I want it does not answer my question.
to answer your initial question, you can call home assistant services from esphome.
Malaki86
(Dennis McKinney)
November 14, 2023, 11:24am
10
The REASON is because I asked HOW, that’s all that’s needed. Thanks for the reply.
and how do you think it is going to be helpful to learn and improve. we might find a better question to ask rather than the original question.
Malaki86
(Dennis McKinney)
November 14, 2023, 12:06pm
12
I asked VERY specific questions. The reasons do not matter.
1 Like
indeeed
November 14, 2023, 3:33pm
13
In this forum you find a thread/post on how to ask a good question - may take some time to read it!
This is exactly what I do and I can control all ha entities like this directly from my esphome nodes thanks to the native api.
# In some trigger
on_...:
# Simple
- homeassistant.service:
service: switch.toggle
...
Malaki86
(Dennis McKinney)
November 14, 2023, 3:39pm
14
indeeed:
In this forum you find a thread/post on how to ask a good question - may take some time to read it!
This is exactly what I do and I can control all ha entities like this directly from my esphome nodes thanks to the native api.
# In some trigger
on_...:
# Simple
- homeassistant.service:
service: switch.toggle
...
Native API Component — ESPHome
Look at my original post and tell me how i asked “wrong”?