Home Automation - Smartkit

That requires location (GPS) to be left on full time on the phone :p

I use it and it works with relative low power (major change location support) - also means it doesn't always update as quickly.

You can also use it without Nabu Casa support - I do.
 
Nah not paranoid, well not about location stuff, about conserving my battery and stuff

It’s really not a concern on any modern phone.

Well I can’t vouch for that Android kak... but on iOS it hardly even registers.

Each app doesn’t make a call for the location, it’s globally shared across the phone so if it’s on for one thing it might as well be on for them all.

Home Assistant uses less than 1% of my battery daily and that’s with active use of the app as well.
 
Random question - if you guys are using google calendar with HA for loadshedding, how are you naming the entries for the different stages?

i.e. - if its Stage 2 - it would need to select the Stage 2 entries from the calendar.
@xrapidx, It was a lot quicker just entering all the times into a Google calendar as they are the same each month and setting each time to recur monthly. Also, I named each time depending on if it was Stage 1, 2 or 3 and if it is stage 1, I'd name it Stage 1,2,3. If the time applied to Stage 2, then I would name it Stage 2,3.

Then I added configurations to specify calendars to only expose events within HA for Stage 1, 2 or 3 and created automation so that if the stage is 1, only the stage 1 times apply, etc. Thankfully I was able to create a sensor back to Eskom's site to determine the stage, so all is quite automated.
 
@xrapidx, It was a lot quicker just entering all the times into a Google calendar as they are the same each month and setting each time to recur monthly. Also, I named each time depending on if it was Stage 1, 2 or 3 and if it is stage 1, I'd name it Stage 1,2,3. If the time applied to Stage 2, then I would name it Stage 2,3.

Then I added configurations to specify calendars to only expose events within HA for Stage 1, 2 or 3 and created automation so that if the stage is 1, only the stage 1 times apply, etc. Thankfully I was able to create a sensor back to Eskom's site to determine the stage, so all is quite automated.

Thanks - I actually finished this morning - not quite automatic, but from SQL, I read in the JSON schedules for the year, output to eight CSV files, which gets input into Google Calendar as individial calenders, these then get read from HA, depending on what stage it is, it references the relevant google calendar.

The google calendar process will take about 10 minutes to reload for a year if necessary.
Screenshot from 2020-02-22 14-46-02.png

Conditional card displays only when there is loadshedding
Screenshot from 2020-02-22 14-50-00.png


And then various automations to shut things down, and send notifications via telegram
 
@xrapidx ahhh really nice! Thankfully the times are the same for each month, so you could simply change all the times to recurring monthly as well saving you time from reloading it in a year's time.

How did you do the countdown?

Also, your sensor reads "Stage 2" instead of "2 Stage" if one had to specify a unit of measure on the sensor. How did you get it to read "Stage 2"?

Also, just wondering about something - if the power is restored before the end time and HA starts up, does the calendar state change to "on" thus triggering the automation again? I've had some occasions (this only happens when I'm at work so I cannot test it) when I find that after power is restored, my HA instance isn't up.
 
@xrapidx ahhh really nice! Thankfully the times are the same for each month, so you could simply change all the times to recurring monthly as well saving you time from reloading it in a year's time.

How did you do the countdown?

Also, your sensor reads "Stage 2" instead of "2 Stage" if one had to specify a unit of measure on the sensor. How did you get it to read "Stage 2"?

Also, just wondering about something - if the power is restored before the end time and HA starts up, does the calendar state change to "on" thus triggering the automation again? I've had some occasions (this only happens when I'm at work so I cannot test it) when I find that after power is restored, my HA instance isn't up.

The problem is changing the times for 8 stages would take forever :p I don't really trust Eskom to not screw around with it. Writing the code probably took about 30min - and its now easily runnable.

RE: countdown - it's just the next load shedding time with a class of Timestamp

RE: the sensor - I actually just hacked a "display" sensor together by prefixing "Stage".

My automations are based on the actual datetime value of the "Next Load Shedding Slot" sensor - so once its executed, the time is past - and it won't execute again until the next slot.

It's all still pretty untidy, still need to neated it up - but at least its working.
 
I have an idea of a use of the sonoff basic unit with Tasmota firmware, but need some guidance from more experienced user/s.

Idea: use the sonoff basic with a buzzer to alert (for a short period, like 3-5 seconds) when the electricity comes back. The sonoff would be wired directly to the incoming 220V line to the house from the outside electricity meter, in the db.

Items needed: sonoff basic, 220V buzzer, some wiring

Problem: if I connect the buzzer to the incoming line of the house (with or without sonoff), it will buzz all the time - which is unwanted. The idea is to program the sonoff so that it only buzzes once (for 3-5 seconds as mentioned) when the electricity comes back, and then turn off. The next time the electricity goes off (and comes back on), the sonoff does the same. This way, you know when the electricity has just come back and can switch off your generator and switch back to mains.

Approach: program the sonoff basic to achieve the above. I did some reading (mostly on github and a few other places) and understood that the following command in the Console of sonoff basic should do the job (currently on Tasmota fw 6.7.1 IIRC):

rule on power1#boot do backlog power1 1;ruletimer1 50 endon

(a note that the PowerOnState was set to 0, meaning that the sonoff basic goes to OFF state initially when the electricity comes back on).

When I plug the sonoff in, the relay does not react. It does show up on the local network and can be controlled (either via the web, or manually using the button) but does not respond to the above command - nothing happens.

Any thoughts? This is the first time I am trying to use the rules on sonoff so I must be doing something wrong. Thanks for any suggestions!
 
Last edited:
Use the inching function in eWeLink to switch the Sonoff on briefly. I imagine you could do this using Tasmota but I have nil experience in that.
 
Thanks - I actually finished this morning - not quite automatic, but from SQL, I read in the JSON schedules for the year, output to eight CSV files, which gets input into Google Calendar as individial calenders, these then get read from HA, depending on what stage it is, it references the relevant google calendar.

The google calendar process will take about 10 minutes to reload for a year if necessary.
View attachment 789219

Conditional card displays only when there is loadshedding
View attachment 789227


And then various automations to shut things down, and send notifications via telegram
Hi Good day would you be so kind as to share with us the code of your conditional card
 
Hi Good day would you be so kind as to share with us the code of your conditional card

Code:
      - card:
          entities:
            - sensor.loadshedding
            - sensor.next_load_shedding_slot
            - sensor.next_load_shedding_slot_timestamp
          type: entities
        conditions:
          - entity: sensor.loadshedding
            state_not: "Stage 0"
        type: conditional
 
Thanks both; will give this a try. Don't think I have any sonoff devices still on ewelink firmware but will check!

Have a look at ESPHome - it is more configurable than Tasmota and can also run automation on the device. Tasmota can do too but ESPHOME is easier to configure.
 
Top
Sign up to the MyBroadband newsletter
X