Home Automation - Smartkit

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
9,139
For those interested in doing automations in HA or without HA, Nodered is pretty damn awesome.

Only recently used Nodered to update me on City of Cape Town's loadshedding, because they almost always different from Eskom.

This is what my flow looks like:
Screen Shot 2018-12-14 at 9.27.28 AM.png
ps. The idea came from someone in a Arduino whatsapp group here in Cape Town.

So whenever City of Cape Town makes a change on the alerts for loadshedding on their website, I get an update on slack, like this:

Screen Shot 2018-12-14 at 9.28.58 AM.png

Anyways, this is only a basic start for me. Found this fantastic Nodered/HA post on Reddit, which convinced me I can do much better automations than I already have in Openhab, by combining Openhab and Nodered.

Do read this post:
https://www.reddit.com/r/homeassistant/comments/a61ro9
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
37,649
I am going to be honest, because I dont use HA, I am not 100% sure.
But what you want, is if the logging happen every 60 seconds, then you want to log the usage for the last 60 seconds every 60 seconds. Thats how a timeseries database works. So it will not be accurate down to the second, but it will be accurate down to every 60 seconds.
Unless you log the usage every second at every second. If that makes sense.

Generally though, most things are logged every 60 or 300 seconds. It depend on how granular you want to be able to go when you look at something specific. Personally I think 60 seconds is accurate enough.
I'll do a comparison - I'm logging both current usage - and daily usage, so should be easy to sum current to see if I can close to daily.
 

InternetLuddite

Expert Member
Joined
Feb 23, 2016
Messages
1,432
For those that did connect their garage door or gate motor (all centurion kit) with a tamotazied sonoff SV.

Did you follow the instructions as listed by Dr zzs video?

Another few questions I have is regarding the reed switch.

1) what type of reed switch must I buy

2) do I need a NC or NO reed switch

3) instead of a reed switch, can I Justin use a normal door/window magnetic contact to do the same - seems it's like a reed switch and it's easier for me to possibly use that rather.

Thx
 

ebendl

Expert Member
Joined
Sep 27, 2004
Messages
3,651
For those that did connect their garage door or gate motor (all centurion kit) with a tamotazied sonoff SV.

Did you follow the instructions as listed by Dr zzs video?

Another few questions I have is regarding the reed switch.

1) what type of reed switch must I buy

2) do I need a NC or NO reed switch

3) instead of a reed switch, can I Justin use a normal door/window magnetic contact to do the same - seems it's like a reed switch and it's easier for me to possibly use that rather.

Thx
I purchased these: http://www.communica.co.za/Catalog/Details/P0950673459

Main reason is that my gate is outside in the sun and elements and I wanted something to take a bit of hammering. Furthermore since your gate doesn't always close with the exact same precision, I wanted something that had a bit of a tolerance. Hence the wide gap - it senses the gate is closed when the two sides of the switch is within 3 - 4 cm of one another.

I got normally/closed switches, meaning when the gate is closed the switch makes contact. But you can swop them around in Tasmota or Home Assistant!

For my garage I actually used the Xioami door sensors since that's "indoors".
 

InternetLuddite

Expert Member
Joined
Feb 23, 2016
Messages
1,432
I purchased these: http://www.communica.co.za/Catalog/Details/P0950673459

Main reason is that my gate is outside in the sun and elements and I wanted something to take a bit of hammering. Furthermore since your gate doesn't always close with the exact same precision, I wanted something that had a bit of a tolerance. Hence the wide gap - it senses the gate is closed when the two sides of the switch is within 3 - 4 cm of one another.

I got normally/closed switches, meaning when the gate is closed the switch makes contact. But you can swop them around in Tasmota or Home Assistant!

For my garage I actually used the Xioami door sensors since that's "indoors".
Thanks :)
 

InternetLuddite

Expert Member
Joined
Feb 23, 2016
Messages
1,432
So I am amped up and ready to connect my sonoff SV to the gate motor. Got the reed switch and planned everything. Put the gate key into lock , barely turned the key without any pressure and it snapped off like it was made out of soft putty. FML. The best part, I put q20 in the lock every 6 months and the lock barrel is covered by insulation tape to prevent water ingress. All for nought.

How the heck am I gonna solve this. I don't want to buy a new gate lock as it appears to be impossible to get to the shank (I think it's called that).

Ideas on a post card :) IMG_20181218_184158.jpeg
 

ebendl

Expert Member
Joined
Sep 27, 2004
Messages
3,651
So I am amped up and ready to connect my sonoff SV to the gate motor. Got the reed switch and planned everything. Put the gate key into lock , barely turned the key without any pressure and it snapped off like it was made out of soft putty. FML. The best part, I put q20 in the lock every 6 months and the lock barrel is covered by insulation tape to prevent water ingress. All for nought.

How the heck am I gonna solve this. I don't want to buy a new gate lock as it appears to be impossible to get to the shank (I think it's called that).

Ideas on a post card :) View attachment 594334
See if you can get the key part out. Then you can usually take it to a locksmith to make you a new one.

A tap on the back might get it out, or some thin pliers. Or a piece of prestik.
 

patrick123

Expert Member
Joined
Apr 10, 2005
Messages
2,862
You already have the key in the lock, drill at a 45 degree angle sort of extending the slot about 3mm deep and then use a flat screwdriver to turn it.


Lock.PNG
 

InternetLuddite

Expert Member
Joined
Feb 23, 2016
Messages
1,432
Solved the lock issue. Youtube provided a good answer.. all I did was push the broken key futher in with the part that I still had and then turned .. I can't believe it worked. Btw, locks - look like they very easy to break. The two spanner method is frightening.:)

Would appreciate help on the HA/MQTT configuration.

I connected my Sonoff SV and I see it coming up on the Wifi. The Dr ZZs video shows the code that one needs to put in configuration.yaml into HA, etc - but when I enter it, config check complains.

Besides the Mqtt/wifi settings, this is what i used for the SV configuration:
Hostname: SONOFF_FrontGate
Mqttclient: SONOFF_FrontGate
Topic: SONOFF_FrontGate
FriendlyName1: Front-Gate

Code:
in configuration.yaml
cover:
 - platform: mqtt
    name: "SONOFF_FrontGate"
    state_topic: "cmnd/gatestate/POWER2"  <<< I used gatestate as that was defined in the console ?
    command_topic: "cmnd/sonoffsv01/POWER"  <<< what does sonoffsv01 refer too
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "ON"
    state_closed: "OFF"
    optimistic: false
I put the following in Tasmota console
PulseTime1 1
Switchretain 1
Powerretain 1
switchtopic2 gatestate <He has garagestate so i renamed to gatestate
switchmode1 0
switchmode2 2

Can someone post their config for a SONOFF SV across all the files i.e. configuration.yaml, customize.yaml, groups.yaml so I can use as a reference? Thank you.
 

Sinbad

Honorary Master
Joined
Jun 5, 2006
Messages
70,417
gatestate/sonoffsv01 relate to the name of the switch you gave it. If you look in the switch's config you'll see the mqtt topic names in there.
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
37,065
gatestate/sonoffsv01 relate to the name of the switch you gave it. If you look in the switch's config you'll see the mqtt topic names in there.
So what he means is you name it wrong and sonoffsv01 should be SONOFF_FrontGate or whatever.

FYI stick to using small letters throughout and make your life simpler.

You can also just call it frontgate. If there is only one device of a kind no need to put Sonoff in there.

The state part also only applies if you have the reed switch in the mix.
 

InternetLuddite

Expert Member
Joined
Feb 23, 2016
Messages
1,432
View attachment 591018

At least I now have confirmation that my spikes are the geyser :D Going to let it run for a week to get usage stats, then try various automation to get it down.
For me , having an efergy for two years now, I learnt that powering geysers for 1h30 daily is enough. when I left them to run 24/7 in our usual use case over a period of weeks for testing the theories, electricity usage jumped between 3-6kw daily.

Sadly , still haven’t connected the sonoff pow R2s to the geyser, maybe this weekend once I understand how to get the Tasmota sonoffs into HA.

Another question : pow r2 can handle 16 amps easily so can handle my 2kw geyser but not my 4kw geyser. I just thought today that it may actually just be easier to replace the 4kw element in my big geyser with a 2kw element so I can use pow r2 to manage it instead of finding solutions like slave relays etc,

Yes, it means I need to leave it on longer - say 3 hours instead of the usual 90 minutes. Is this a good idea and is it possible? Need to check what geyser I have to be sure I can get a compatible element ...
 

ebendl

Expert Member
Joined
Sep 27, 2004
Messages
3,651
Can someone post their config for a SONOFF SV across all the files i.e. configuration.yaml, customize.yaml, groups.yaml so I can use as a reference? Thank you.
Config checks that fail are almost ALWAYS Yaml formatting and indentation issues. What is the error?

This:
Code:
command_topic: "cmnd/sonoffsv01/POWER"  <<< what does sonoffsv01 refer too
means the name of the MQTT topic that you gave it in the Tasmota config.

In other words, here:

Screen Shot 2018-12-19 at 12.52.24.png

I can share mine, but be aware I'm using one Sonoff SV purely for opening / closing of the gate and then another Sonoff Basic connected to a light but also with an additional reed switch for detecting whether the gate is open or not. And I don't have it set up as a cover.
 
Top