Home Automation - Smartkit

To help you out a little this is my log when opening the gate, stopping it and closing it again.

17:15:17 MQT: tele/frontgate/SENSOR = {"Time":"2020-05-25T17:15:17","Switch2":"closed"}
17:15:50 MQT: stat/frontgate/RESULT = {"POWER1":"closed"}
17:15:50 MQT: stat/frontgate/POWER1 = closed (retained)
17:15:50 MQT: cmnd/gatestate/POWER2 = open (retained)
17:15:51 MQT: stat/frontgate/RESULT = {"POWER1":"open"}
17:15:51 MQT: stat/frontgate/POWER1 = open (retained)
17:15:56 MQT: stat/frontgate/RESULT = {"POWER1":"closed"}
17:15:56 MQT: stat/frontgate/POWER1 = closed (retained)
17:15:57 MQT: stat/frontgate/RESULT = {"POWER1":"open"}
17:15:57 MQT: stat/frontgate/POWER1 = open (retained)
17:15:58 MQT: stat/frontgate/RESULT = {"POWER1":"closed"}
17:15:58 MQT: stat/frontgate/POWER1 = closed (retained)
17:15:59 MQT: stat/frontgate/RESULT = {"POWER1":"open"}
17:15:59 MQT: stat/frontgate/POWER1 = open (retained)
17:16:09 MQT: cmnd/gatestate/POWER2 = closed (retained)

and my code for it.

Code:
 - platform: mqtt
    name: "Front Gate"
    state_topic: "cmnd/gatestate/POWER2"
    command_topic: "cmnd/frontgate/POWER"
    availability_topic: "tele/frontgate/LWT"
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "open"
    state_closed: "closed"
    payload_available: "Online"
    payload_not_available: "Offline"
    optimistic: false
    retain: false

Good chance you also aren't using the cmnd topic for the state in HA.

So, i finally got my SV GPIO14 connected to a mag switch and configured SonoffSV as necessary

But when I use your code in my Hass.IO (in switches.yaml) ... I get the error

Invalid config for [switch.mqtt]: [state_open] is an invalid option for [switch.mqtt]. Check: switch.mqtt->state_open. (See ?, line ?).

Same for the payload _open/close,stop commands:
Invalid config for [switch.mqtt]: [payload_open] is an invalid option for [switch.mqtt]. Check: switch.mqtt->payload_open. (See ?, line ?).

If I comment out the payload and /or state_open/closed lines, hass.io doesn't generate an error.

YAML:
  - platform: mqtt
    name: "Garage Door"
    icon: mdi:garage
    state_topic: "stat/SONOFF_Garage/POWER2"
    command_topic: "cmnd/SONOFF_Garage/POWER"
    availability_topic: "tele/SONOFF_Garage/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
# payload_open: "ON"
# payload_stop: "ON"
# payload_close: "ON"
    payload_available: "Online"
    payload_not_available: "Offline"
   # state_open: "open"
   # state_closed: "closed"
    optimistic: false
    retain: false

What have I done wrong. Using latest Hass.IO .. if it makes a difference

Also what is the YAML code, to make the door work like that i.e. the up/down arrow + stop button

1591542552713.png

Many thanks
 
Last edited:
So, i finally got my SV GPIO14 connected to a mag switch and configured SonoffSV as necessary

But when I use your code in my Hass.IO (in switches.yaml) ... I get the error

Invalid config for [switch.mqtt]: [state_open] is an invalid option for [switch.mqtt]. Check: switch.mqtt->state_open. (See ?, line ?).

If I comment out the state_open/closed lines, hass.io doesn't generate an error.

YAML:
- platform: mqtt
name: "Garage Door"
icon: mdi:garage
state_topic: "stat/SONOFF_Garage/POWER2"
command_topic: "cmnd/SONOFF_Garage/POWER"
availability_topic: "tele/SONOFF_Garage/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
# state_open: "open"
# state_closed: "closed"
optimistic: false
retain: false

What have I done wrong. Using latest Hass.IO .. if it makes a difference

Also what is the YAML code, to make the door work like that i.e. the up/down arrow + stop button

View attachment 855101

Many thanks
Change it to ON AND OFF
 
So, i finally got my SV GPIO14 connected to a mag switch and configured SonoffSV as necessary

But when I use your code in my Hass.IO (in switches.yaml) ... I get the error

Invalid config for [switch.mqtt]: [state_open] is an invalid option for [switch.mqtt]. Check: switch.mqtt->state_open. (See ?, line ?).

If I comment out the state_open/closed lines, hass.io doesn't generate an error.

YAML:
- platform: mqtt
name: "Garage Door"
icon: mdi:garage
state_topic: "stat/SONOFF_Garage/POWER2"
command_topic: "cmnd/SONOFF_Garage/POWER"
availability_topic: "tele/SONOFF_Garage/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
# state_open: "open"
# state_closed: "closed"
optimistic: false
retain: false

What have I done wrong. Using latest Hass.IO .. if it makes a difference

Also what is the YAML code, to make the door work like that i.e. the up/down arrow + stop button

View attachment 855101

Many thanks

That’s because I’ve changed the topics to actually say open and closed instead of on and off.

So either change the topics or as above change the code to on and off.

Sorry I had forgotten about that and should have highlighted it. Changed it way back because on/off annoyed me in the Tasmota interface.

The icons should work automatically.
 
I have two of these that I bought without checking properly and now they won't fit snug on the socket.


I'm looking to swap for our standard sized ones.
 
That’s because I’ve changed the topics to actually say open and closed instead of on and off.

So either change the topics or as above change the code to on and off.

Sorry I had forgotten about that and should have highlighted it. Changed it way back because on/off annoyed me in the Tasmota interface.

The icons should work automatically.

So now it's like this:

Code:
  - platform: mqtt
    name: "Garage Door"
    icon: mdi:garage
    state_topic: "cmnd/SONOFF_Garage/POWER2"
    command_topic: "cmnd/SONOFF_Garage/POWER"
    availability_topic: "tele/SONOFF_Garage/LWT"
    qos: 1
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
  #  payload_on: "ON"
  #  payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_open: "ON"
    state_closed: "OFF"
    optimistic: false
    retain: false

Still getting the errors if the new payload or state commands are not commented out.
:
Invalid config for [switch.mqtt]: [payload_open] is an invalid option for [switch.mqtt]. Check: switch.mqtt->payload_open. (See ?, line ?).

Even If paste the code as SauronZA posted in my config, Hass config check throws an error about payload or state invalid. Is there something else I should have done?
 
Oh yeah it always moans about the payloads ON being invalid but I don’t believe there is a way to fix that as it’s what Tasmota expects.

It’s just cosmetic and will work regardless of it.

I still get the same one in my logs as well.

*****

Oh I see your problem you’ve put it under switch.mqtt.

This is all for cover.mqtt.

Bit of an assumption there on my part that you had used some guides and knew this was for MQTT Covers and not Switches.

Those options are indeed invalid for switches.

If you find the MQTT Cover docs for HA I believe you’ll be all sorted. It’s also why your icons didn’t work.
 
Oh yeah it always moans about the payloads ON being invalid but I don’t believe there is a way to fix that as it’s what Tasmota expects.

It’s just cosmetic and will work regardless of it.

I still get the same one in my logs as well.

*****

Oh I see your problem you’ve put it under switch.mqtt.

This is all for cover.mqtt.

Bit of an assumption there on my part that you had used some guides and knew this was for MQTT Covers and not Switches.

Those options are indeed invalid for switches.

If you find the MQTT Cover docs for HA I believe you’ll be all sorted. It’s also why your icons didn’t work.
Thanks, gonna read up on it, saw it being referred to in dr.zzz video but didn't know the theory behind it. Thx so much.
 
Just a bit pricey, but worth it.

I think the time saved will be worth shifting costs over to the client on a new install, also AC/DC offer bulk discount prices if you buy bulk.

Can I use this to flash tasmota?


Yes, looks like it, they specifically mentioned ESP modules but no mention of a 3.3V power supply to power it up. Just make sure signal set to 3.3V otherwise it will get bricked.

Also check these out...


And when they allow collection, I'm going to grab this for flashing my Sonoffs:-

 
The best part was the wago connectors, first time I use them and they are lifechanging. To power all 4 mini's I simply used a 5 way Wago, forcing all that into a black connection block would have been a pain.
I still need to find a place to buy some of those, have been seeing people using them on youtube for ages.
 
To confirm, you connected with an IP150 running v4 firmware, and your connection is via Swan or is it local?

If Swan, then my question is , what happens when your insite gold subscription ends?

My point being, if we forced to continue to pay for swan when we run just via Hass feels unfair.

I still have a year left but gonna try to connect today if my children allow me . Biggest issue would be the wife. Maybe this could help push her to using hass.io more on her phone. :)
Okay, I just checked and I upgraded mine to 4.40.004 because I have a MG5050.

I'm connecting to the panel directly (Local Network IP) via the PAI add on.


Compatibility: https://github.com/ParadoxAlarmInterface/pai/wiki/Compatibility
 
I still need to find a place to buy some of those, have been seeing people using them on youtube for ages.
I also only saw it online originally, until I went to AC/DC recently to get a PCB enclosure and saw them there. They have a few different ones and keep some of them at the counter... similar to lollipops and fish marshmellows at 7/11... you can't help but take a couple :)
 
A sensor is the best solution but if you don't use SW today you could set the shelly to detached relay and every time the relay is set to on you could send url to toggle the sw state then the sw state will tell you the state of the door


A bit random I know. But you could do this as a sensor for the door position on a shelly 1
 
Old automation: I'm looking for a clapper switch to connect to my bedlamp. ???
 
So looking into adding motion for night light late at night I want the lights to go on, but at a dim level as to not bright the night walkers inside the house.

Found this thread which looks like something @Method was asking about, unless a different Method:P

Anyways will be awesome to turn on lights at like 5-10% brightness only, so enough to find you way through the house without killing my eyes. Still very much a fan of the Shelly dimmers, I am not contemplating using them in more places than originally planned.
 
I use lamps for that, they come on as you move around the house, the bulbs are dimmable (Xiaomi or Philips).
 
So looking into adding motion for night light late at night I want the lights to go on, but at a dim level as to not bright the night walkers inside the house.

Found this thread which looks like something @Method was asking about, unless a different Method:p

Anyways will be awesome to turn on lights at like 5-10% brightness only, so enough to find you way through the house without killing my eyes. Still very much a fan of the Shelly dimmers, I am not contemplating using them in more places than originally planned.
lol that's not me :p

But I have something like that, that I use in the bathroom. It nice to go to the bathroom and not pee on the floor because you can't see where it's going, but it also doesn't blind you :D

 
lol that's not me :p

But I have something like that, that I use in the bathroom. It nice to go to the bathroom and not pee on the floor because you can't see where it's going, but it also doesn't blind you :D

Ah yes have that too for the bathroom...because the light has an extractor fan connected to it, so cant dim there.
But for the rest of the house where I have dimmers.
 
Just a thought, not sure if anyone has an idea on the feasibility or what would happen:

Sonoff Mini's have an S1 and S2, what if I had multiple mini's and connect all their S1's to one common wire that goes to a light switch, and S2 each of course on a different gang on the switch.

Could this theoretically work?
 
Top
Sign up to the MyBroadband newsletter
X