Shelly Binding

:+1:
thank you

ok, we are going to close the release

pre-final is available with various bugfixes, improved handling for password protected devices, health monitor/alarming (now trigger channel), updated README,

3 Likes

hi
thanks for this binding 
 it gives much more comfort then using mqtt.

i’ve a question about the button event. how can i read the button events?
i’ve try this with the code below, but i doesn’t work, i can’t read some events.

Thing shelly:shelly25-relay:690xxx "EgHaustuer" @ "EgTr" [deviceIp="192.xxx.xxx.xxx", userId="", password="", lowBattery=15 , eventsCoIoT=true ]

` rule “Test event shelly”
when
Channel ‘shelly:shelly25-relay:690xxx:relay1#event’ triggered
then
sendNotification(“keller-marcel@hispeed.ch”, “Trigger”)
var actionName = receivedEvent.getEvent()

switch(actionName)
{
    case "SHORT_PRESSED": 
    {
        sendNotification("keller-marcel@hispeed.ch", "Short-Pressed")
    }

    case "DOUBLE_PRESSED": 
    {
        sendNotification("keller-marcel@hispeed.ch", "Double-Pressed")
	}

    case "LONG_PRESSED": 
    {
        sendNotification("keller-marcel@hispeed.ch", "Long-Pressed")
    }

    case "LONG_RELEASED":
    {
        sendNotification("keller-marcel@hispeed.ch", "Long-Released")
    }
}

end

this rule is never triggered. the other function like relay, power, energy,
 works fine.
has someone an idea whats the problem?

Please wait before using the button events. As part of the review we revised the concept and I will implement this during the week. I‘ll add a trigger channel of type button so the device events are available 1:1

The roller brings the matching mechanism to process to get the open/close/stop events.

Anyways you need to enable the events in the thing config. Be aware: enabling button and output at the same time could(!) cause device reboots with older firmware releases. 1.5.6 is more stable, but it still happens. This has already been reported to the Shelly guys.

thanks for the fast answer and your great work on this binding. i will wait for the next version.

openHAB 2.5 is heređŸ€ 
and it includes the Shelly binding!

Thanks all of you, which contributed the this journey.

The initial build supports only the 2.5 release installation. I‘ll provide shortly information how to run this build on 2.4 or 2.5M4-6.

Check out the updated README, which is included in the 2.5 build.

Stay tuned. Thx, Markus

7 Likes

Thanks a lot for this binding, i was waiting for this for a long time.

Can anyone help me to add this to the habpanel?

I cant figure it out how to do it.

Thanks in advance

That’s properly the subject of it’s own thread, and has nothing to do with the binding.

Continuing the discussion from Shelly Binding:

Hi,

I am using a version 2.5.0-SNAPSHOT.jar from around 4th of November.

I have just noticed, that the binding sets the roller Open/CLOSE and STOP URL of my shellies 2.5.
The problem is, that it uses the IP of the docker container openhab is running in. So the shellies will never be able to call the urls successfully. In this case the IP 172.22.0.6.

Is it possible to configure the binding so that the IP of the docker host is used. Here 192.168.178.XX?

Regards,

Holger

Congratulation for the successful integration. This will make it a lot easier for many people to use OpenHAB and Shelly together.

Best regards,
Christian


I run my OpenHAB-Containers with their own IP from the Host-Subnet.
This is working fine with the Shelly-Binding as the Container acts like a dedicated machine.
Look about ‘macvlan host networking’ (https://docs.docker.com/network/macvlan/)

Kindest regards,
Christian


Sorry if im not explaining well.

On PaperUI is working fine and the binding is working with the shellys, turning on or off.

Anyone have added via html the bindig so we can show up on the habpanel, and control the ligths on habpanel, thats my question.

The binding does not get added by or to HTML.

To control/display Shelly devices from HABpanel, there are two basic steps.
Link your Shelly devices to openHAB Items. This involves the binding, channels, Things etc. Have you got that far?

Once you’ve done that, an Item is an Item, it doesn’t matter what binding it has to do with, if any. “How to use HABpanel to display and control some Items” is nothing to do with Shelly binding.

Hi,

what are the experiences with the reaction time?
How much delay does occure?

Thanks
Chris

what do you mean?

the delay between clicking a UI button and reaction of the device? It‘s instant

A status change of the device, which was not triggered by openHAB could face some delay, because the API provides only a limited set of events: e.g. pushing a button, sends an event and the status gets updated within 1-3s. Whereas a config change done by the Shelly App could take up to 1 minute, because there is no device event.

I tried to optimize and find a good balance between event driven actions and polling. That‘s also the only reason why I integrated Coap, because you can‘t wakeup the battery powered devices to poll them (they don‘t support WOL)

I have been using this awesome binding now for a whole day and i noticed the Shelly Plug-S has a neat kWh featture. THe device returns the kWh value instead of watt-minute. I just bought a shelly plug (no s) which does not support this it seems. I get the mqtt report on the channel: shellies/shellyplug-xxxxxxx/relay/0/energy. The plug-s also reports the value on the energy part but i guess the binding has a built in rule which ports this to the kWh value in openhab?

Am i doing something wrong or is this not (yet) supported?

Thanks in advance, and please forgive me if this is a dumb question, just started with OH

yes, the binding does the conversion to kw/h
I think Watt Min is really unusual

The Plug has no integrated power meter and no LED control

I think it does: Output from MQTT.fx
shellies/shellyplug-xxxxx/relay/0/energy the value is watt per minute.

For reference, heres the plug-s:
shellies/shellyplug-s-xxxxxx/relay/0/energy the value is watt per minute as well.

Or am i missing something? the shelly MQTT page also mentions:
shellies/-/relay/0/energy` to report amount of energy consumed in Watt-minute

if the power meter does not work its quite useless to me to be honest. On of my main concerns is keeping tabs on the usage over the coarse of a longer period

Both the Plug and the Plug-s do have energy measurement built in:

Might there be another way to resolve this? I have no concept of how the bindings are preconfigured, but i guess if i manually add this Shelly, i would be able to add the channel and then use a rule to convert the watt per minute to kWh right? Would be quite a bummer tough, i would have 1 shelly configured differently from all the others.