Giter VIP home page Giter VIP logo

Comments (14)

deadly667 avatar deadly667 commented on May 20, 2024 1

Also you can add automation when you detect power outage (UPS on battery mode) and after power is back online you turn OFF lights. Ikea lights has fun feature that they turn ON when they got power.

Its just happened to me while we were on vacation. Power outage and after all lights in house was ON, of course I didnt think about it and lights was ON for one day till I didnt see it on my mobile phone :/

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024 1

@CCOSTAN - that will be a great inspiration and help with DIYBMS project I'm working on and DIY PowerWall. Thanks for pointing me in that way! Although I'll have it set as proof of concept projects since I live in apartment and would break bunch of building codes I guess :)

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

That's great idea! And you are right!
Philips Hue had that problem, but they updated firmware long time ago to fix this issue.

Have to think a bit more about this one, since it's possible for UPS to shutdown Synology NAS and HA then would not know what to do on boot, when power get's back.

from home-assistant_config.

deadly667 avatar deadly667 commented on May 20, 2024

Well yes, I was thinking about it. For that case when UPS shutdowns everything you cannot do much and this is the worst scenario. You can put that on every restart of HA turn off lights but then you need to add boolean sensor for development (intentional restart) to skip that automation but its not easy and you need to remember to set boolean before restart otherwise you will turn off lights at evening and family will be, lets say, unhappy :D.

I didnt cover this worst scenario because I know that I will forget that boolean. Also I set notification for low battery on UPS so I will know that soon it will shutdown everything. If that happens when nobody is at home than I cannot do anything because you cannot start Synology remotely (if Im not wrong).

from home-assistant_config.

deadly667 avatar deadly667 commented on May 20, 2024

To be precise Synology will go into safe mode, it will not shut down itself BUT in safe mode he shutdowns everything (all services) and also unmounts all disks and next expected action is power loss or cold boot according to Synology documentation.

from home-assistant_config.

CCOSTAN avatar CCOSTAN commented on May 20, 2024

I've done some work on this based on my Powerwall usage. You might find some ideas and code in there.
CCOSTAN/Home-AssistantConfig#779

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

@deadly667 - it would be great if you cold save state between HA restarts. If there is a way, I'm not sure on how to do it.
In theory, I have an idea, but that would be big hack - to publish specific MQTT message and then on each reboot to check for that message state.... Maybe that could work. But since I now use add-on MQTT, I guess that it's not running or could be delayed during HA startup.
Or based on your idea, probably, easiest way would be to have automation on statrup check if it's daylight and if specific light is on (light that is NEVER on during day), to then turn all lights off...

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

I've captured 3 states of UPS so far. Haven't tested if there is "OB CRITICAL" or not when battery is at critical state, but I guess that there is additional state available.

States I got so far:

When all is OK - Battery full and on mains
Ups Status : Online
Ups Status Data : OL

When on batteries:
Ups Status : On Battery Battery Discharging
Ups Status Data : OB DISCHRG

When on mains and battery charging
Ups Status : Online Battery Charging
Ups Status Data : OL CHRG

Now I should catch states OB DISCHRG and temporarily save it in booblean.
It should be checked on startup of HA and if set to true/on - wait 5 minutes and turn lights off (just to give Zigbee network few more minutes to try and sync back).

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

Now we have 3 automation:

  • UPS_power_failer.yaml - this one is triggered when UPS kicks in sets input_boolean to on
  • UPS_battery_full.yaml - it is triggered when battery is full and if input_boolean state is on .
    This is for when power is restored while HA is still running
  • UPS_battery_failed.yaml - every HA restart this one runs, but is only triggered if input_boolean is set to on.
    Turns lights off and notifies.

If I thought of everything, this should handle all events of UPS correctly. Both when power is restored without failure and also when power is restored after UPS shuts down.
Is this it @deadly667 ?

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

Here is how it looks now:
image
and
image

Third case is hard to test as I would need to cut power to UPS until it dies, and since batteries have lost majority of the capacity I think they wouldn't trigger shutdown in time. So, until I replace batteries, that will not be tested.

Left to do is to make Alerts on remaining capacity and that will wait for battery replacement too...

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

Closing this issue for now as I can't test anything until I replace UPS batteries.
Had replace battery alarm (continuous high pitch beep) at 5:50 AM on Sunday - not funny, took about 15 minutes to reset it.

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

Old batteries have been removed and new ones are in.
I will conduct some power failure tests over the weekend.

from home-assistant_config.

stale avatar stale commented on May 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from home-assistant_config.

BeardedTinker avatar BeardedTinker commented on May 20, 2024

Due to new unplaned test, I have a bit more stats about UPS now.
Power lost:
image
UPS depleted:
image
And power restored.
image
But HA didn't start properly - have to see what happened there.

from home-assistant_config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.