Finally ordered my Shelly 2.5

Could you reveal how you program this? This ‘automation’ is running on the Shelly itself, right? So is there an interface to program it?

Also I am very curious about the HA configuration. Would you care to share yours?

EDIT: 8-sep-2019: please look for my more recent post for a config change and an updated and better indented configuration.

For the configuration itself I have:
cover:

  • platform: mqtt
    name: rolluik
    command_topic: “shellies/shellyswitch25-123456/roller/0/command”
    position_topic: “shellies/shellyswitch25-123456/roller/0/pos”
    set_position_topic: “shellies/shellyswitch25-123456/roller/0/command/pos”
    availability_topic: “shellies/shellyswitch25-123456/online”
    payload_available: “true”
    payload_not_available: “false”
    qos: 0
    retain: false
    payload_open: “open”
    payload_close: “close”
    payload_stop: “stop”
    position_open: 100
    position_closed: 0
    optimistic: false

And this automation for syncing the current status whenever I restart HA :
- id: ‘1554734137382’
alias: ‘HA boot: Shelly announce ivm status’
trigger:

  • event: start
    platform: homeassistant
    condition: []
    action:
  • data:
    payload: announce
    topic: shellies/command
    service: mqtt.publish
1 Like

Regarding your question about how one can program the button you can do this in the app or webgui of the Shelly.
Momentary - Press Button 1 for OPEN and Button 2 for CLOSE.
Toggle - Press Button 1 for OPEN and press again for STOP.
Press Button 2 for CLOSE and press again for STOP.

1 Like

Regarding setting the shutter to a specific percentage opened, this is fully integrated in HA. HA knows that it’s a shutter and gives you a slider. And if desired you can also specify a specific percentage in an automation rule.

1 Like

Awesome thanks for sharing your implementation.

I am looking forward to order 4 pcs, 2 for my shutter/cover and 2 for my floor lights.
Hope they will support my floor lighting as you can control it from two switches.

Is it mandatory to announce the state on HA bootup via an automation?

You’re welcome.
The shelly 2.5 comes with a single throw contact, I think for your application if you need to be able to switch one light using two switches you need a double throw contact.
Yes, the state announce is mandatory as otherwise HA will not reflect the current state of the Shelly after you restarted HA. (I think without it it said unknown state or so)

Thanks for sharing! I’m not sure which button to choose; I have a switch that can be set to left or right to open or close the sunscreen. Well, I’ll just try and see which one works best. Your code is really helpfull.

My next steps will be to automatically close the sunscreen when the sun goes down. And maybe if I have a windspeed sensor one day, I can even automatically open the sunscreen and close it when the wind will be too hard.

Yes, you can create some automation rules for that, combined with weather info from buienradar or some local wind/temperature sensor. I am still fine tuning my rules but since I’m from the Netherlands the summer about to start so I can see how it is behaving. This also counts for my garden irrigation system :grinning:, but that’s another story.

What a shame that I became aware so late about the Shelly. Think this is the cheapest way to get your home lighting and covering smart imho.

Will order some Shelly 2.5 and give it try :smile:

1 Like

Ok, ordered 2 Shelly 1 for the beginning, I am very excited as I got no electrician skills :joy:

Hope I will make it with some video tutorials :grimacing:

Hmm. I don’t want any blood on my fingers… Please install together with someone who knows stuff.

I’m assuming you still can’t connect any additional sensors that run off 3v to the new Shelly 2.5 or Shelly 1PM. Can someone confirm?

Also, any major differences between the Shelly 2.5 and Shelly 1PM except the fact that Shelly 2.5 has Roller/Shutter functionality and duel relay for controlling two devices? I’m thinking if I only need one switch for my light, the Shelly 1Pm is more than enough for that.

I haven’t seen any configuration settings for external sensors. And I think you’re right about the difference.
If you want to know for sure you can reach out to the Shelly support group on Facebook. There are Shelly employees in that group know all the ins and outs.

1 Like

Hello @pathia, sorry for bringing back this thread, but I dont know why the buttons on my cover do not work, only the slider works. My configuration is the same as yours. Thanks

I just set up my new shelly 2.5. I have it working from the app, but would like to set up in HA. Im using mqtt, but dont see any examples on how to set up 2 switches. Im not using it to control shutters. Also using stock firmware since mqtt support built in.

I would suggest that you use some of the available mqtt sniffers to see if & what HA sends when you press the button.
For windows I can suggest mqtt fx or mqtt explorer.

Almost the same answer for you, but with a twist : use mqtt explorer or mqtt fx to see what mqtt messages the Shelly sends when you press the buttons in the Shelly app. I’m sorry but I don’t use the Shelly 2.5 like you do, so I can’t check.

Hey Patrick,

I was able to figure it out. In my case, its just the shelly1 syntax but doubled, so:

  • platform: mqtt
    name: “Tennant Back Door Light”
    state_topic: “shellies/shellyswitch25-008463/relay/0”
    command_topic: “shellies/shellyswitch25-008463/relay/0/command”
    qos: 2
    payload_on: “on”
    payload_off: “off”
    retain: false
    optimistic: false

  • platform: mqtt
    name: “Tennant Main Light”
    state_topic: “shellies/shellyswitch25-008463/relay/1”
    command_topic: “shellies/shellyswitch25-008463/relay/1/command”
    qos: 2
    payload_on: “on”
    payload_off: “off”
    retain: false
    optimistic: false

The main difference is relay/0 vs relay/1.

Works fantastic.

1 Like

Makes sense. Also, thanks for sharing the code as this could help out other folks in the future. :ok_hand:

I have looked into why my automation rule was necessary, thinking it should be something I could get rid of. It seemed that my shellies do not send out a LWT. So I have changed this in my Shelly 2.5 configuration, along with the retain flag on the device itself and that way you will see a online = true when the device is online and when it goes offline the MQTT broker sends a online = false message. That way HA will pickup the online status of the device immediately. So there is no need for a configuration change on the HA side. Other than removing the now unneeded automation rule when HA boots up. For your reference I’ve included the configuration I posted earlier but now with proper indenting for the forum.

cover:
  - platform: mqtt
    name: rolluik
    command_topic: "shellies/shellyswitch25-123456/roller/0/command"
    position_topic: "shellies/shellyswitch25-123456/roller/0/pos"
    set_position_topic: "shellies/shellyswitch25-123456/roller/0/command/pos"
    availability_topic: "shellies/shellyswitch25-123456/online"
    payload_available: "true"
    payload_not_available: "false"
    qos: 0
    retain: false
    payload_open: "open"
    payload_close: "close"
    payload_stop: "stop"
    position_open: 100
    position_closed: 0
    optimistic: false
1 Like