Home Automation - Smartkit

Haha awesome!

When I tested my eazylift garage motors, shorter pulsetime wouldn't always take, and I noticed the same when using the physical buttons on them. If you think about it, humans will also press the button closer to a second than 100milliseconds.

Yeah I assumed my remotes were just starting to run a bit flat (inherited with the house) as you often need to hold them a little bit longer.

So now here's an odd question but probably nobody here using Homekit.

Is there any way to get "in the middle" of commands sent to HomeKit devices with HA? Reason being that Homekit will trigger an automation for the garage door, front gate and alarm regardless of it's current status.

So basically I want to put in a "open...only if closed", "arm only if disarmed" etc.

Come to think of it I'm not sure if HA even takes the state into account by default? But then my buttons in HA already took the state into account so it sort of does I guess.
 
I set my pulsetime to 1 for both my Sonoff SVs driving the centurion gate and garage door - seems to be working a treat. Isn't 10 too long?

That’s 0,1 seconds.

I don’t think any human can press a button that quickly.

But if it works it works.
 
So weird problems last night and this morning after operating yesterday afternoon without issue.

Alarm would just randomly arm/disarm itself meaning at 4am this morning it also tripped and woke everyone up and again at about 6:30 when nobody was doing anything special.

Normally I would say this is a short of some kind, but with a relay actuating behind it how can it be shorting unless the relay is the problem and tripping at random?

Could the "retain" flag inside HA be causing this? It's the only oddity I seem to remember adding to the config yesterday and would explain why my garage was also open when I just got home.

*****

Seems it is indeed the retain flag in HA which is what I added yesterday.

Either that or Ghost Switching, but then I wouldn't expect the garage to be wonky too which has been fine for a few weeks.
 
Last edited:
So weird problems last night and this morning after operating yesterday afternoon without issue.

Alarm would just randomly arm/disarm itself meaning at 4am this morning it also tripped and woke everyone up and again at about 6:30 when nobody was doing anything special.

Normally I would say this is a short of some kind, but with a relay actuating behind it how can it be shorting unless the relay is the problem and tripping at random?

Could the "retain" flag inside HA be causing this? It's the only oddity I seem to remember adding to the config yesterday and would explain why my garage was also open when I just got home.

*****

Seems it is indeed the retain flag in HA which is what I added yesterday.

Either that or Ghost Switching, but then I wouldn't expect the garage to be wonky too which has been fine for a few weeks.
I don't use the retain flag anywhere. But that is like leaving a command there to be executed.
 
Hmmm... I wonder if this is why my garage sometimes opens after I restart a component.

It's exactly why it seems.

I didn't have it in there before and added it yesterday as the current status wasn't coming up by itself after a restart.

Also seems to happen if it loses connection to HA.

The tricky part is even if you change the config it's still retained and you need to go overwrite the messages on the broker.
 
Retain only works well if the other software keeps track of messages it already received. I doubt tasmota does that. Retain is you absolutely can not accept losing a message. Since this is for home automation and most mqtt clients we use doesn't keep track, it's mostly best left turned off.
 
I think I set the flag because I was restarting frequently, but now the system is up for days at a time.
 
Retain only works well if the other software keeps track of messages it already received. I doubt tasmota does that. Retain is you absolutely can not accept losing a message. Since this is for home automation and most mqtt clients we use doesn't keep track, it's mostly best left turned off.

Tasmota is actually the most accurate it seems.

Home Assistant is the one that isn't very reliable.

The part I just can't figure out is how to get Tasmota to report it again (or HA to fetch it) if HA restarts. At present it only updates when the state changes.
 
Tasmota is actually the most accurate it seems.

Home Assistant is the one that isn't very reliable.

The part I just can't figure out is how to get Tasmota to report it again (or HA to fetch it) if HA restarts. At present it only updates when the state changes.
Hmm.

Try retain turned on in the tasmota mqtt config, but leave it turned off in HA.
 
Hmm.

Try retain turned on in the tasmota mqtt config, but leave it turned off in HA.

Yeah that's precisely what I have done.

Well I had it enabled in Tasmota the whole time, just then decided to add it in HA as well as the status wasn't updating.

Now it still doesn't update but at least my stuff works. Tasmota doesn't "push" it to HA or maybe HA doesn't "fetch" it.
 
When they say...

"The device state will always be synced each TelePeriod (every 5 minutes by default). "

Do they mean it will be updated on Tasmota itself? That doesn't mean it gets published to HA though?

The 5 minutes is synchronization of the device state via MQTT. Open up a console on the device and you can see the MQTT messages being sent. Tasmota will always remember the last state on power up. You should turn off retain. You will also need to clear the retain messages from your broker

https://github.com/arendst/Sonoff-Tasmota/wiki/PowerOnState-Configuration
 
The 5 minutes is synchronization of the device state via MQTT. Open up a console on the device and you can see the MQTT messages being sent. Tasmota will always remember the last state on power up. You should turn off retain. You will also need to clear the retain messages from your broker

https://github.com/arendst/Sonoff-Tasmota/wiki/PowerOnState-Configuration

In HA?Because I've already done that fix the problem (turn off Retain in HA and reset the messages). Or do you mean turn it off on Tasmota as well? I've got Powerretain and SwitchRetain enabled.

My problem is that my current status doesn't come through to HA...until I actually do something to change the state. Would the sync advise resolve that specific part of the issue?

Poweron state isn't really my concern as I want the relay off in all cases except with user intervention. The state of the GPIO14 is the real concern which is writing to POWER2 and therefore needs to be retained.
 
Okay it seems the problem is actually that the cmnd/alarmstate2/POWER2 is only ever updated when the button is pressed and never again.

But thing is tele/alarm/SENSOR which publishes every 5 minutes is in the format...

tele/alarm/SENSOR = {"Time":"2019-01-08T16:34:21","Switch2":"disarmed"} (retained)

So I'll need to value_template that stuff out if I want "live" updates?

****

Okay seems MQTT Alarm Component doesn't actually support value_template so I'm up **** creek with this one. It will just need to be what it needs to be.

Fortunately only really restarts when it updates in the middle of the night.
 
Last edited:
Okay it seems the problem is actually that the cmnd/alarmstate2/POWER2 is only ever updated when the button is pressed and never again.

But thing is tele/alarm/SENSOR which publishes every 5 minutes is in the format...

tele/alarm/SENSOR = {"Time":"2019-01-08T16:34:21","Switch2":"disarmed"} (retained)

So I'll need to value_template that stuff out if I want "live" updates?

****

Okay seems MQTT Alarm Component doesn't actually support value_template so I'm up **** creek with this one. It will just need to be what it needs to be.

Fortunately only really restarts when it updates in the middle of the night.
Try setting the TelePeriod in the console, then you can get it to publish between 10 and 3600 seconds.
 
Try setting the TelePeriod in the console, then you can get it to publish between 10 and 3600 seconds.

That's not the problem at all.

Alarm MQTT doesn't support value_template modification and so I cannot use the tele stats, regardless of how often they update.

But it's not big deal, it will be a rare occasion that I won't have a status update in between restarts.
 
That's not the problem at all.

Alarm MQTT doesn't support value_template modification and so I cannot use the tele stats, regardless of how often they update.

But it's not big deal, it will be a rare occasion that I won't have a status update in between restarts.
You need to persist the state data. I use simple dB or something in Openhab. It only stores the last value per item. So restarts is a non issue.
 
Top
Sign up to the MyBroadband newsletter
X