Integrate Annex-ESP into Homeassistant the easy way

Place code snippets and demo code here
efalken
Posts: 38
Joined: Tue Mar 02, 2021 3:47 pm
Has thanked: 17 times
Been thanked: 27 times

Integrate Annex-ESP into Homeassistant the easy way

Post by efalken »

After years with OpenHab I was struggeling to integrate my new solar system (Huawei ).
Then I gave Homeassistant a new try - and voilà: THIS THING IS AMAZING.
It recognizes nearly every electronic (TV, Stereo, Computers, Phones) or IoT device (Tasmotas, ...) in my home instantliy with a user friendly interface.
Using MQTT as the easiest method to interact between devices (also in Annex) I tested a code to make ANNEX-Devices appear in Homeassistant the same way as industrial hardware does (MQTT-Device).
The code is for ESP32 but can be adopted for ESP8266 easily.
Just upload, run and watch in HA a new device (ESP_kitchen_1) as example.
Good luck and happy winter-coding.
Erhard
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by Electroguard »

Sounds promising.
What are you running HA on ?
And are you also running a local MQTT server ?
efalken
Posts: 38
Joined: Tue Mar 02, 2021 3:47 pm
Has thanked: 17 times
Been thanked: 27 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by efalken »

Shure, my HA runs in a docker container on my NAS besides a mosquitto-broker instance. But docker can run even on a raspberry or any other and evenly on older hardware. Docker is a must nowadays! All free and open source. HA can also run on a raspberry 3b and up alone with all possabilities.
The setup is quite simple and there are tons of instructions online (youtube...).
For my solar system i had to ad the HACS-extension but with google and github its all easy stuff - even for me...
Also my energycounter (optical interface) was easy to set up (using a Tasmota script).
Any data is collected and displayed automatically in HA but in the long run one should use influxdb and grafana or simalar.
Good luck.
tcpipchip
Posts: 76
Joined: Fri Apr 02, 2021 12:48 am
Been thanked: 59 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by tcpipchip »

efalken
Posts: 38
Joined: Tue Mar 02, 2021 3:47 pm
Has thanked: 17 times
Been thanked: 27 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by efalken »

yeah, good old openhab. Give HA also a try, realy worth it.
regards.
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by Electroguard »

Hi efalken, I am pleased you opened my eyes to Home Assistant, I've been greatly impressed by what I've seen and heard about it.
I'm keeping variables to a minimum while trying it out, so have installed HA OS on a bootable USB for now, cos installing docker on MX Linux is a whole new experience best left for afterwards.

HA configured itself for my wired network, but I think I need to manually configure HA wifi for it to connect to my isolated Annex wifi subnet.
Once HA is configured for the Annex subnet, will I need to install a wifi gateway for it to communicate with the ESP devices ?

If so, what is your opinion of the one in the link below - bearing in mind that HA will be running on an isolated subnet without access to voice activation services or any other cloud services, so I don't want to be wasting my money on something I cannot use... therefore I would value your advice.
https://www.aliexpress.com/item/1005005 ... uuv4VcjMWb
efalken
Posts: 38
Joined: Tue Mar 02, 2021 3:47 pm
Has thanked: 17 times
Been thanked: 27 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by efalken »

Hello, nice to hear from you.
I also don't like to spend money on hardware with special closed firmware like zigbee or cloudsevices or anything alike.
I run everthing on a NAS-System 24/7. All my devices share files from there and there are also many programs hosted suitable for my IoT.
I have not tried HA on a USB-Stick, but the fully blown HA comes with a mqtt-brokcer build inside (missing in the docker version).
So i run mosquitto alongside as seperate container. All my data travel over MQTT - fast and easy.
Before buying special new hardware of that type think about an old laptop or PC (15 years old is just fine) or a used raspberry pi (3B and up). With such systems you have all possibilities for your OWN data and can learn a lot. Set up a linux server or use a special HA-image for RP.
Good luck.
Erhard
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by Electroguard »

Hi again,
I tried to avoid waffling too much, so I suppose I didn't make things very clear.
I installed the full Home Assistant Operating System onto a 128Gb USB boot stick which I can boot on a spare desktop PC (as if it was an ssd or hdd).
I don't know if it includes MQTT Broker, but this is just temporary to get a feel for things, before installing it to ssd on the same PC, which has 12Gb RAM, RJ45, wifi, bluetooth, vga, loads of USB slots, and is normally used to test linux distros either from Ventoy multi-boot menu, or installed on ssd.
HA OS is booting on it from USB and running quite happily as a fairly powerful headless server which I can connect to from the browser on another PC.
If all goes well, I am considering eventually deploying HA and MQTT broker and Samba etc on DietPi to a dedicated little headless server.

I have seen info online about how to configure HA for a required wifi SSID.
But I have also seen a lot said about various wifi protocols needing a specific type of hub or gateway device.
I have also seen confusing mention about most hubs/gateways integrating with online voice assistant services like alexa and siri, but very few which say they can run locally without cloud service, and only an odd one or two which specifically mentioned Home Assistant (typically the most expensive ones).

One of the youtube HA tutorials said that almost any zigbee compatible gateway should provide wifi connectivity, suggesting that HA needs a hub/gateway in order to communicate with the various wifi device protocols.
And this was a Q & A from an Ali seller:
Q:Can this hub control WiFi smart products in the same app?
A:This hub can form a whole house linkage for all the products in your same one app for the hub is connected via the wifi router,but this is the ZigBee version,so it can only be connected with Zigbee devices,no WiFi devices available.
That seems confusing, conflicting, and therefore worrying.
You already have HA communicating with Annex ESP wifi devices (using MQTT), so you are the ideal person to ask if my HA wifi SSID connection should allow it to communicate ok with the Annex ESP devices (via MQTT) and other wifi items such as thermostat, weather station, CCTV cams etc, or if I would need to order something extra like a tuya/zigbee hub/gateway device.

Edit: Is ok, gonna get this gateway below, it mentions bluetooth as well as wifi, and doesn't break the bank, so just need to hope it actually works with HA.

gateway.jpg
You do not have the required permissions to view the files attached to this post.
efalken
Posts: 38
Joined: Tue Mar 02, 2021 3:47 pm
Has thanked: 17 times
Been thanked: 27 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by efalken »

Hi,
Zigbee is a special protocoll send by special devices. If you have some there is no way around a gateway.
Your Tuya-device will most certanly rely on a cloud service in China.
I wonder apart from that why you are using several different wirleless networks. They all have to come together somewhere and their transmissions are unsecure anyway considering ESPs.
I try to keep it simple. One Ethernet over a wifi-router (any type will do), a solid firewall and https-connections to the outside world.
But if a had a ton of gold in my home I would be more carefull too.
greetings
Erhard
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 274 times
Been thanked: 322 times

Re: Integrate Annex-ESP into Homeassistant the easy way

Post by Electroguard »

I don't have much to protect, efalken, but I prefer to keep our annex and cctv devices separate and isolated from our internet use.
So I have 2 different wired subnets needing several hubs/switches to cover the area, and both those subnets need several wifi routers and repeaters at the various locations, which are spread out more than 100 meters.
So it uses 8 wifi routers, 4 or 5 hubs/switches/, a wired router, and a wifi repeater - but it often changes.


That's why I am interested in HA, because instead of needing to send all signals to all areas for access by different apps and devices, I think I may be able to keep most of it in one central location and access it via any HA consoles from the various locations.

Was a nightmare marathon to get things to where they are though, and I won't risk messing things up until I'm happy that I have a worthwhile replacement... cos our gate cams are our eyes, and gate sensors are our ears which trigger an Annex Talking Sentry alarm that speaks announcements in the various locations. Annex has also let me build in redundancy by having a live standby sentry alarm just waiting to step in to make announcements if needed ... so I am mindful that I must have dependable HA redundancy also.

So I know where I want to get to, and that it's not likely to be a quick journey... but it looks like it may be quite an interesting one.
Post Reply