openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.58k forks source link

[shelly] Support for Shelly Pro Dimmer 2PM #16409

Open markus7017 opened 7 months ago

markus7017 commented 7 months ago

Add support for the dual Pro dimmer

troem commented 7 months ago

Good idea!

mstroeve commented 5 months ago

I installed a pro 2dm and discovered this device is not supported yet? Bountysource is gone. Any other way to add incentive for adding these model?

troem commented 3 months ago

I integrated the shelly dimmer via quick and dirty "http"-things implementation:

Thing http:url:shelly_light_1og4 "Shelly Light" [
    baseURL="http://192.168.x.x",
    commandMethod="GET",
    contentType="application/json",
    refresh=10
] {
    Channels:
        Type switch : power0 "Power0" [
            commandExtension="/rpc/Light.Set?id=0&on=%2$s",
            stateExtension="/rpc/Light.GetStatus?id=0",
            stateTransformation="JSONPATH:$.output",
            onValue="true",
            offValue="false"
        ]
        Type dimmer : brightness0 "Brightness0" [
            commandExtension="/rpc/Light.Set?id=0&brightness=%2$s",
            stateExtension="/rpc/Light.GetStatus?id=0",
            stateTransformation="JSONPATH:$.brightness"
        ]
        Type switch : power1 "Power1" [
            commandExtension="/rpc/Light.Set?id=1&on=%2$s",
            stateExtension="/rpc/Light.GetStatus?id=1",
            stateTransformation="JSONPATH:$.output",
            onValue="true",
            offValue="false"
        ]
        Type dimmer : brightness1 "Brightness1" [
            commandExtension="/rpc/Light.Set?id=1&brightness=%2$s",
            stateExtension="/rpc/Light.GetStatus?id=1",
            stateTransformation="JSONPATH:$.brightness"
        ]
}