Hi All, I am going to look into getting some type of notification when there is a Grid Outage. Initially this will be from Home Assistant, but if @TheDragon_Giv (Paul) gets involved we might see if it is possible in the GE app for any Grid outage (at your home only, not a grid outage in your area)
My Kit:-
Gateway, 2 x AIO, GE EVC & SolarEdge PV Inverter.
What I have done so far:-
I test a Grid outage on my system once a quarter to ensure it all works.
Below are the things I see change when this happens. If your interested and can help please let me know if you see any other changes etc, we can look at to implement a notification.
- Inverter Relay Voltage
- Grid Relay Voltage
- Phase 1 Voltage
- Phase 1 Current
- Gateway Mode (this changes from On grid to Fault)
Once we get a good list the next stage is to set up an automation and get a notification. I must admit I have never set up an automation and/or notification. So may need some help here please.
P.S. if you don’t have a GW but some sort of EPS or backup battery that supports your router etc and have a different GE system, please also help.
2 Likes
My app currently displays OUTAGE, but there is no notification. Would an notification sound be useful to AIO owners?
3 Likes
Here’s a script I took and adapted from the original provided by @PianSom
It triggers and sends an alert to your mobile device (running the Home Assistant Companion app) if grid power is lost or restored, using the grid current to detect this.
A check against uptime (which you have to install, its a standard HA integration) is made to stop false alerts when HA is rebooted.
alias: Grid Status Notification
description: Notifies loss / resumption of grid status to home battery system
triggers:
- trigger: numeric_state
id: grid_lost
entity_id:
- sensor.givtcp_xxx_grid_frequency
below: 48
for:
minutes: 1
- trigger: numeric_state
id: grid_resumed
entity_id:
- sensor.givtcp_xxx_grid_frequency
above: 48
for:
minutes: 1
conditions:
- alias: Uptime is more than 5 minutes
condition: template
value_template: >-
{{ ( as_timestamp(now()) - as_timestamp(states('sensor.uptime')) ) >= 300
}}
actions:
- if:
- condition: trigger
id:
- grid_lost
then:
- action: notify.mobile_app_[mobileid]
data:
title: Power Cut
message: >
{{now().strftime('%-d %b %H:%M')}}
Connection to the grid lost - house is on battery. Current load is
{{ states('sensor.givtcp_xxx_load_power')|int }}kW. Current SoC is
{{ states('sensor.givtcp_xxx_soc')|int }}%. Battery will last
approximately {{
((states('sensor.givtcp_xxx_discharge_time_remaining')|int)/60)|int
}} hours.
data:
visibility: public
persistent: true
push:
sound:
name: default
critical: 1
volume: 0.8
- if:
- condition: trigger
id:
- grid_resumed
then:
- action: notify.mobile_app_[mobileid]
data:
title: Grid Power Restored
message: >
{{now().strftime('%-d %b %H:%M')}}
Connection to the grid resumed. Current load is {{
states('sensor.givtcp_xxx_load_power')|int }}kW. Current SoC is {{
states('sensor.givtcp_xxx_soc')|int }}%.
data:
visibility: public
persistent: true
mode: single
1 Like
Thank you @geoffrey & @PianSom
If you have never set up an Automation in HA please follow these instructions:-
To create a new automation:
- Settings / Automations & Scenes
- Create Automation / Create new Automation
- Three dots (top right corner) / Edit in YAML
- Delete the existing (template) automation code and copy/paste the supplied automation code above
I’ve updated the automation to remove the dependency on my notify script, now it calls the notify.mobile_xxx directly so is more easy to just cut & paste into HA
1 Like
Hi all, a quick note, as the GW does not have a sensor grid_frequency, you should use one of the above but only 1-4. I am still working on number 5.
I have used grid_relay_voltage.
Hi yah, I have worked out I am no good at coding or common sense in setting up automations. I have been trying for over an hour and when I run the automation it fails. If you have time can you help please, no hurry if you’re busy.
You are just running the automation by hand - correct? So it ignores the trigger section and just runs the actions (the command you are running is “Run actions” after all!)
So when it runs the actions it
1 - first see if the grid_lost trigger has been hit. It hasn’t, so it moves on. Then
2 - see if the grid_resumed trigger has been hit. It hasn’t, so it terminates
So all working as required! (You can see this is what happens by following the yellow line in your screen grab above.)
I don’t know if this will work, but you could try going to the Developer Tools / States section and try setting the voltage sensor to 40, see if that triggers the automation to run a grid failure. If it does then you should get a resumed pretty quickly afterwards, when givtcp writes the correct value back.
Thank you for the confidence, I will see if I can turn the grid off tomorrow or Monday to test it.
If you get time can you also help me with an automation for a notification when the Gateway Mode sensor changes from Online to Fault please.
Did the Developer Tools trick not work?
Not sure what I am doing. Is it this and change the current from 0 to 40?
Just did a Grid failure test and it did not work so I have got something wrong?
I got no notification.
Oh I need to install uptime, it is uptime kuma? Or something else
No, I meant that screen, but inputting sensor.WHATEVERITIS_grid_relay_voltage
BUT - thinking further - I don’t think that this workaround will work. Even if you set the voltage to 40 it does not mean that inside the automation the trigger id will be set to grid_lost
- because you are only running the actions. And so no trigger will be triggered. So you won’t get any message.
Sorry. I can’t think of a workaround that doesn’t involve you cutting the power.
What does the Trace show?
It’s very easy to add triggers via the user interface, have a go and you’ll learn how they work.
The only non obvious thing is you’ll need to add a trigger id and if you repeat one of the existing ones for your new entity it’ll then follow the same execution logic
1 Like
You did wait for 1 min? Because that looks like it is still waiting for a minute to elapse …
Yup waited about 5m. I can also see this