All About Automations

"
As someone with a lot of networking knowledge who tried it - it is currently impossible to run Home Assistant in the cloud. HA has a monolithic architecture which is regrettably as archaic as it is hard to change at this point in time. The monolith essentially means that HA was never properly split into its separate components (UI, storage, connectivity, integrations) and is therefore in no way capable of running the integrations on another host than the rest. Changing to enable the core system and the persistence layers on a cloud server, attach a number of dynamic integration proxies (of which one on a Pi or Arduino at my home), and then select per integration on which proxy to run it would require a fundamental and very painful refactor or even rewrite of HA.

The alternatives are not viable. While for example Zigbee2MQTT will happily run like this (it’s implictly its own proxy and you can just connect MQTT via VPN or even public internet) integrations that depend on LAN features like discovery - not so much. Setting up a VPN, with a bunch of complex routing rules, will eventually get you to the point where your cloud instance can directly control your Sonos device or whatever. It will however never discover them, as broadcasts are not forwarded by any bridging VPN for very good reasons, and even if you manage to do it (I did in the end) the integrations are most of the time still broken because they assume L2 connectivity features. So you end up with a system that works a lot of the time, or appear to do so, and you cannot rely on it which defeats the entire purpose of a home automation system.

The reason I tried to set it up are simply reliability and stability. When the electricity drops in my house, or the fuse my Pi is connected to blows, or my fiber modem crashes, in a well designed microservices architecture with proper redundancy it should just list the integrations that run there as temporarily unavailable. My Home Assistant should then still be accessible (via 4G/5G if need be), still show web integrations like my calendars and weather reports, hell even my Tesla integration would still work, HA would just be a bit less functional. The idea is awesome. But impossible.

TL;DR: HA is designed to be run as a whole on a single system. Having most of HA run somewhere and just some integrations somewhere else is currently not feasible. If they ever refactor the ‘integration hosting’ away from the core awesomeness can ensue but not today.

(disclaimer: I use the shorthand term ‘in the cloud’ for what it actually means: “a computer of which the physical location is unspecified and unimportant to its use”. This may be a colocated uber-secure personal server, an AWS/GC/DO/Azure machine or a VM from a local vendor, whatever floats your boat. Concerns about specific cloud vendors are irrelevant to this discussion)" https://community.home-assistant.io/t/home-assistant-in-the-cloud/436220/18
Heh, I ran in to the same thing, just with VLANs. If you HA is on a different VLAN to your IOT devices...so much pain.

I ended up, having the HA VM on the same VLAN as all the IOT stuffs. So only HA is exposed to those IOT devices.
 
- Warning on phone if I've used more than 500l of water in a day.
- Warning on phone if there is less than 25 kWh on prepaid meter.
- Snapshot and video clip notification on telegram if movement is detected on outside cameras.
- Picture in picture notification on TVs when movement is detected on outside cameras.
- Warning on phone if alarm is not turned on at sunset.
- Automatically run geyser earlier if there is loadshedding in normal running timeslot.
- Turn off TVs when idle for 10min

Hi Jakes,

I'm wondering how you are monitoring your water consumption? Do you have a sensor in your council water meter, or did you install your own meter+sensor? Similarly, how are you integrating with your prepaid electricity meter?
 
Hi Jakes,

I'm wondering how you are monitoring your water consumption? Do you have a sensor in your council water meter, or did you install your own meter+sensor? Similarly, how are you integrating with your prepaid electricity meter?
Both esp32/esphome solutions, for water I'm using a reed switch in the council meter and for the electrical prepaid meter I'm using a photodiode to detect the imp/kWh led.
 
To add my 2c to the automations side of this thread, I have solar, and a resistive geyser, and when my batteries are full enough that I expect there to be excess solar (i.e. panels stop producing because the load is too small, and I can't export it), I dump the excess energy into my geyser.

Construction thread here: https://mybroadband.co.za/forum/threads/esphome-geyserwise-smart-thermostat.1231463/ (although MyBB seems to have lost the pictures I uploaded)

This is based on a custom thermostat for my geyser (and a smaller 2kW element than the default 3kW Kwikot one), so when the geyser starts heating, the automations check whether it is between 4pm and 9am, and if so, turn off the inverter timer, but set battery charge current to 0A, so that the geyser heats from the grid in the evenings without draining my battery. However, if it is between 9:00 and 16:00, the battery is more than 70% State of Charge, and the solar production is greater than 2500W for 5 minutes, then set the geyser thermostat to 70C (normally 45C), otherwise if the battery discharge rate goes above 500W for 10 minutes, set the thermostat back to 45C.

It works really well, on a good day I can import as little as 700W from the grid, because the geyser doesn't need to heat up overnight at all (unless my kids use all the hot water when they shower!). That 700W being the 30W "minimum draw" from the grid to prevent the meter from detecting backfeeding * 24 hours. And it adjusts automatically for overcast days by tracking what the battery is doing. I monitor it periodically, but don't often need to touch it.
 
- Warning on phone if I've used more than 500l of water in a day.
- Warning on phone if there is less than 25 kWh on prepaid meter.
How are you doing these two things?

I recently installed a borehole, next will be the Tank and Pressure Pump - Already got the borehole pump on a smart breaker which I can control from HA.

Now I am also looking at this:
I have recently ordered a Tank level sensor that works with Tuya and therefore automate rather than relying on paid for apps - am excited about that . I also see that there are irrigation control boxes that work with Tuya that can autmate with weather.


@Adhvik how was the installation and usage of the Tuya Tank level sensor?

Regarding the Smart Irrigation, I have the previous model of this: https://www.geewiz.co.za/smart-home...ion-controller-2nd-gen.html#/880-zones-6_zone which has worked amazingly well! Got it hooked up with Irrigation Unlimited to control it along with my weather
 
That 700W being the 30W "minimum draw" from the grid to prevent the meter from detecting backfeeding * 24 hours
Regarding this, I had successfully reduced my Trickle feed to 10W without any issues, which has greatly reduced the grid consumption for me.
 
How are you doing these two things?

I recently installed a borehole, next will be the Tank and Pressure Pump - Already got the borehole pump on a smart breaker which I can control from HA.

Now I am also looking at this:




@Adhvik how was the installation and usage of the Tuya Tank level sensor?

Regarding the Smart Irrigation, I have the previous model of this: https://www.geewiz.co.za/smart-home...ion-controller-2nd-gen.html#/880-zones-6_zone which has worked amazingly well! Got it hooked up with Irrigation Unlimited to control it along with my weather
alias: 500l water warning
description: ""
mode: single
triggers:
- entity_id:
- sensor.util_water_usage_daily
above: 0.5
trigger: numeric_state
conditions: []
actions:
- metadata: {}
data:
message: 500l used
title: "water usage "
action: notify.persistent_notification
- data:
message: Water usage high
action: notify.mobile_app_haos
- metadata: {}
data:
message: Water usage for the day above 500l
title: Water usage high
action: notify.all_devices

and



alias: Prepaid Credits Low
description: ""
triggers:
- entity_id:
- sensor.prepaid_credit_remaining
below: 15
trigger: numeric_state
conditions: []
actions:
- metadata: {}
data:
message: "Prepaid low credits "
title: Less than 25 credits left
action: notify.persistent_notification
- action: notify.telegram
data:
message: Prepaid Credits Low
title: Prepaid Credits Low
mode: single
 
alias: 500l water warning
description: ""
mode: single
triggers:
- entity_id:
- sensor.util_water_usage_daily
above: 0.5
trigger: numeric_state
conditions: []
actions:
- metadata: {}
data:
message: 500l used
title: "water usage "
action: notify.persistent_notification
- data:
message: Water usage high
action: notify.mobile_app_haos
- metadata: {}
data:
message: Water usage for the day above 500l
title: Water usage high
action: notify.all_devices

and



alias: Prepaid Credits Low
description: ""
triggers:
- entity_id:
- sensor.prepaid_credit_remaining
below: 15
trigger: numeric_state
conditions: []
actions:
- metadata: {}
data:
message: "Prepaid low credits "
title: Less than 25 credits left
action: notify.persistent_notification
- action: notify.telegram
data:
message: Prepaid Credits Low
title: Prepaid Credits Low
mode: single
Haha sorry I should have clarified, as in what hardware are you using to monitor water and electricity usage?

I have my Inverter hooked up and using that for kWh usage, but it isn't 100% accurate.

Regarding the water, I have been looking around for something like this:
 
Regarding the water, I have been looking around for something like this:

I have my eye on this.
Tuya Smart WiFi Water Valve
APP On/Off Control
Water pressure / Flow Rate / Temperature measurement Water consumption monitoring

It’s super expensive in my eyes, but about half the price of that Swedish unit! I like that you can monitor water pressure, eg shut off the valve at 3am, and watch for the pressure dropping, to indicate a slow leak. Fast leaks should be discernible by continuous flow. Temperature not that useful, I guess!
 
I have my eye on this.
Tuya Smart WiFi Water Valve
APP On/Off Control
Water pressure / Flow Rate / Temperature measurement Water consumption monitoring

It’s super expensive in my eyes, but about half the price of that Swedish unit! I like that you can monitor water pressure, eg shut off the valve at 3am, and watch for the pressure dropping, to indicate a slow leak. Fast leaks should be discernible by continuous flow. Temperature not that useful, I guess!
Really cool indeed! Only concern would be if I can integrate it into HA, via Tuya Local or Official Tuya...
 
Really cool indeed! Only concern would be if I can integrate it into HA, via Tuya Local or Official Tuya...

Well, it claims to be Tuya, so I expect you can, like any other Tuya device. Personally, I’d be looking at LibreTiny to make an ESPHome firmware for it.
 
Haha sorry I should have clarified, as in what hardware are you using to monitor water and electricity usage?

I have my Inverter hooked up and using that for kWh usage, but it isn't 100% accurate.

Regarding the water, I have been looking around for something like this:
I’m also interested in the ability to monitor the prepaid meter (especially since mine is in the garage) but I’m nowhere near the level of techie required to put the kinds of solutions together that requires ESP’s, etc
 
I’m also interested in the ability to monitor the prepaid meter (especially since mine is in the garage) but I’m nowhere near the level of techie required to put the kinds of solutions together that requires ESP’s, etc
If you have grid usage stats available then you can set up a simple automation in HA that minuses the daily usage from an input number and will alert you when it is below a certain amount. The caveat is that you manually need to update this value when you top up. If you are fully solar and only top up a few times a year its not that bad.

Another option is a cheap (or extra) camera pointed at the prepaid meter. You only really need an image every few hours. Basic option is to display the image on a dashboard, more advanced you can run image recognition on it and get the value for further automations.
 
Haha sorry I should have clarified, as in what hardware are you using to monitor water and electricity usage?

I have my Inverter hooked up and using that for kWh usage, but it isn't 100% accurate.

Regarding the water, I have been looking around for something like this:
Both are ESP DIY solutions, for water I'm using a reed switch on the municipal meter and a photodiode on my pre paid meter to read the impulse signals.
 
Both are ESP DIY solutions, for water I'm using a reed switch on the municipal meter and a photodiode on my pre paid meter to read the impulse signals.
I also have the reed switch implemented and works great, however due to me moving off-grid with my water as well, I am looking for something to track the homes consumption - Might bite the bullet and order the AliExpress one
 
I also have the reed switch implemented and works great, however due to me moving off-grid with my water as well, I am looking for something to track the homes consumption - Might bite the bullet and order the AliExpress one
If you do get it, I would be really interested to see how it goes. Even pictures of the insides, etc, before you set it up, if you'd be prepared to go that far. Assuming it is not ultrasonically welded, or have an IP67 rating, etc.
 
If you do get it, I would be really interested to see how it goes. Even pictures of the insides, etc, before you set it up, if you'd be prepared to go that far. Assuming it is not ultrasonically welded, or have an IP67 rating, etc.
After looking at the reviews, some people had problems with that one - So I decided to shop around a little more and found this:

Worked out to just over R3k, which I have ordered and should be delivered by 9 Feb
 
After looking at the reviews, some people had problems with that one - So I decided to shop around a little more and found this:

Worked out to just over R3k, which I have ordered and should be delivered by 9 Feb
Nice! I look forward to hearing how well it works.
 
How is this for bad timing...

Just got home after being away for 2 days, noticed my geyser acting funny and within 30 minutes of it automatically switching off, the water would almost immediately go cold.

Double checked the temp probe and the Element, all in order.
Only way to cool down a geyser that quick is to have a HOT water tap running...

Went to look at my Water Meter, reading was super high! Did my last reading on 14 Jan and since then I have now used 22kl - FFS!

We have guests visiting and obviously before we all left on Friday morning, they forgot the Hot water tap open - Someone switched it off when we got home earlier this evening.

Really pissed off right now as this is going to cost more than the water meter I ordered! I would recommend some kind of monitoring ASAP for everyone.

Also going to make a permanent plan to power my REED switch ESP Device that I was running on batteries
 
Top
Sign up to the MyBroadband newsletter
X