Shelly Wifi Door and Window Sensors Review

Yes, mqtt.

Yes, it is not immediate.

I usually have to wait 5 seconds, more or less.

Mine is connected via mqtt.

It’s acceptable in my case, I have just one on the apartment door.

Yeah when you use wifi and batteries (ie deepsleep), there is going to be added latency due to wifi authorization, and also dhcp if you don’t use a static ip. That can be a bummer for some automations. Zwave devices can fill the gaps here. For alarm use, something to think of is having 5sec of latency may be enough time for said burglar to hit the esp device with a hammer before the alarm gets triggered.

hi everyone, an update for Shelly Door / Window came out yesterday.
they finally implemented vibration and tilt.

Shelly Door/Window: MQTT

Taking inspiration from this topic I implemented the device as follows:

####################################################
#                                                  #
#                Shelly Door/Window                #
#                                                  #
####################################################

binary_sensor:
  - platform: mqtt
    state_topic: "shellies/shellydw-xxxxxx/sensor/state"
    name: "Shelly Door/Window Sensor"
    payload_on: 'open'
    payload_off: 'close'
    qos: 0
    device_class: door
  
  - platform: mqtt
    state_topic: "shellies/shellydw-xxxxxx/sensor/vibration"
    name: "Shelly Door/Window Vibration"
    payload_on: 'vibration detected'
    payload_off: 'no vibration'
    qos: 0
    device_class: vibration

sensor:
  - platform: mqtt
    name: "Shelly Door/Window Lux"
    state_topic: "shellies/shellydw-xxxxxx/sensor/lux"
    value_template: '{{ value|round(0) }}'
    qos: 0
    device_class: illuminance
    unit_of_measurement: 'lux'

  - platform: mqtt
    name: "Shelly Door/Window Battery"
    state_topic: "shellies/shellydw-xxxxxx/sensor/battery"
    value_template: '{{ value|round(0) }}'
    qos: 0
    device_class: battery
    unit_of_measurement: '%'

  - platform: mqtt
    name: "Shelly Door/Window Tilt"
    state_topic: "shellies/shellydw-xxxxxx/sensor/tilt"
    value_template: '{{ value|round(0) }}'
    qos: 0
    unit_of_measurement: '°'
    icon: mdi:angle-acute

everything seems to work except the vibration that is not detected even if from the interface via the schelly’s ip when I do the vibration test it works instead HA does not detect any status.
Could anyone try to see if this works for you?

binary_sensor: 
  - platform: mqtt
    state_topic: "shellies/shellydw-xxxxxx/sensor/vibration"
    name: "Shelly Door/Window Vibration"
    payload_on: 'vibration detected'
    payload_off: 'no vibration'
    qos: 0
    device_class: vibration

I don’t understand if I wrote something wrong or it’s a Shelly bug
Thanks

2 Likes

Any improvement in the delay between opening a door/window and it reporting its state?

Try this:

binary_sensor: 
  - platform: mqtt
    state_topic: "shellies/shellydw-xxxxxx/sensor/vibration"
    name: "Shelly Door/Window Vibration"
    payload_on: 1
    payload_off: 0
    qos: 0
    device_class: vibration
2 Likes

no indeed in my opinion and reading on shelly’s facebook page it seems that it is even worse than before.

I tried your solution but it doesn’t return any results equally maybe it’s Shelly’s problem

One last try:

    payload_on: '1' 
    payload_off: '0'

I just tried but even so it does not work … through the IP of the shelli displays the vibration instead of HA nothing … mah

Well the api reference definitely says 1 and 0 for the payload. And the topic looks correct.

Have you tried looking in your mqtt broker With mqtt explorer to see if the topic is correct (or if anything is actually being published for vibration).

I did not know this MQTT Explorer program … really done well, however after installing it, I triggered the vibration and returned the following message:

dw

Does the number change when you retrigger it?

And more importantly does it eventually return to 0?

dw

yes now is 0

Is the triggered number always 128 or does it change depending on how hard you vibrate it?

I have tried many times and when the value is 0 the vibration is not triggered instead when it is at 128 (the value does not vary based on how much vibration there is or at least doing 4 or 5 tests the value has always been the same) the vibration is taken

Then that makes it easy.

payload_on: '128'
payload_off: '0'

yes now everything works thanks for helping me!

place the complete configuration for other people to here could serve

####################################################
#                                                  #
#                Shelly Door/Window                #
#                                                  #
####################################################

binary_sensor:
  - platform: mqtt
    state_topic: "shellies/shellydw-xxxxxx/sensor/state"
    name: "Shelly Door/Window Sensor"
    payload_on: 'open'
    payload_off: 'close'
    qos: 0
    device_class: door
  
  - platform: mqtt
    state_topic: "shellies/shellydw-xxxxxx/sensor/vibration"
    name: "Shelly Door/Window Vibration"
    payload_on: '128'
    payload_off: '0'
    qos: 0
    device_class: vibration

sensor:
  - platform: mqtt
    name: "Shelly Door/Window Lux"
    state_topic: "shellies/shellydw-xxxxxx/sensor/lux"
    value_template: '{{ value|round(0) }}'
    qos: 0
    device_class: illuminance
    unit_of_measurement: 'lux'

  - platform: mqtt
    name: "Shelly Door/Window Battery"
    state_topic: "shellies/shellydw-xxxxxx/sensor/battery"
    value_template: '{{ value|round(0) }}'
    qos: 0
    device_class: battery
    unit_of_measurement: '%'

  - platform: mqtt
    name: "Shelly Door/Window Tilt"
    state_topic: "shellies/shellydw-xxxxxx/sensor/tilt"
    value_template: '{{ value|round(0) }}'
    qos: 0
    unit_of_measurement: '°'
    icon: mdi:angle-acute

I followed your advice, but in spite of everything I can’t show the sensor in the home assistant; my configuration in binary sensor is the following:

  • platform: mqtt
    state_topic: “shellies / shellydw-F3BB0E / sensor / state”
    name: “door sensor”
    payload_on: ‘open’
    payload_off: ‘close’
    qos: 0
    device_class: door

  • platform: mqtt
    state_topic: “shellies / shellydw-F3BB0E / sensor / vibration”
    name: “Shelly Vibration door sensor”
    payload_on: ‘128’
    payload_off: ‘0’
    qos: 0
    device_class: vibration

Please also follow this advice, (point 11 especially): How to help us help you - or How to ask a good question

sensore

That’s a screenshot. That is not what point 11 asked you to do. For a very good reason. I can’t cut and paste sections of code for correction from a screenshot to help you.