ThePheonixGuy / sunsynk-scraper-addon

MIT License
8 stars 2 forks source link

Gridstatus #13

Open Frikkie50 opened 1 year ago

Frikkie50 commented 1 year ago

How easy would it be to get grid status from this - Ie grid on/off?

ThePheonixGuy commented 1 year ago

Last time I checked, kind of difficult. I use another element in my system to detect grid presence, and combine it with the Load Shedding status integration to detect if the power outage is load shedding or something else.

I'll take a second look if there is a way of detecting it straight from the sunsynk website.

Frikkie50 commented 1 year ago

New to HA - so was hoping for an easy way. Ill guess id need to detect if there is a feed comming in (20w) if that is 0 = grid off or something like this.

ThePheonixGuy commented 1 year ago

This is one of the issues - if you watch your power graph on HA for the Grid power node, you'll notice when you are running off only solar and battery, BUT grid IS available, the grid power value will hop between 20 and 0. The "trickle" feed the inverters do is not a permanent trickle.

But will dive deeper and see if there is anything we can do find to scrape for a grid availability status. The sunsynk website does have some way of knowing this, so there must be something we can find

TanPau1412 commented 1 year ago

What i did here was look for the 0w grid power for more than 5 minutes and a condition to see if any of my non-essentials like pool pump/geyser/aircon is in an "unavailable" state - then toggle input boolean to on state via an automation to indicate loss of grid power. Once grid power > 0, then turn off the toggle. Works 99.9% of the time. I then used the loadshedding data to determine if the power outage is scheduled or not load shedding related.

Frikkie50 commented 1 year ago

I am using something similar. Not as advanced. Would you mind sharing @TanPau1412 ?

TanPau1412 commented 1 year ago

I'm not sure if my solution is the most elegant way of doing it, but I don't mind sharing. Step 1 - Create a helper - Toggle - that can be named something like "Grid Power Status" Step2 - Create an automation that will control the state of the toggle : a. Trigger - numeric state of sensor.sunsynk_grid_power is less that 1 for 5 minutes (Trigger ID - Power loss) b. Trigger - numeric state of sensor.sunsynk_grid_power is greater than 0 (Trigger ID - Power Restore)

a. Actions - If triggered by Power Loss. Add conditions to look for non-essential devices like a geyser or pool pump (When those are unavailable you know that the power is really off ) Call Service- Input boolean: Turn off - "Grid Power Status" helper toggle b. Actions - If triggered by Power Restore then Call Service- Input boolean: Turn on - "Grid Power Status" helper toggle

Now you will have an indicator that is accurate (to a large degree of certainty) in determining the grid status.

For the second part I use the load shedding sensor.load_shedding_area_XXXXX_X_XXXX from the load shedding integration in my automations (mainly for broadcasts and notifications) If this sensor is ON and my Toggle and my Grid Power Status is OFF, I know its scheduled load shedding. If the load shedding sensor id OFF and my Grid Power Status is OFF, then I know that the power outage is unplanned.

Hope this made sense and can help :)