ALLTERCO/shelly-script-examples

Unable to find scripts/webhooks to control Philips Hue with shelly i4 plus

Opened this issue · 8 comments

The shell i4 plus order page states:

Whether you use Shelly Wi-Fi bulbs, Philips Hue, or even different brands smart bulbs, Shelly Plus i4 is highly compatible and can control them all!

 

Furthermore, you can use Shelly Plus i4 to set the light color you want or for dimming of your smart bulbs. All you have to do is add and configure one of our scripts or webhooks created specifically for Shelly Plus i4.

And then the learn more link directs me here, however I can not seem to find the scrips or web hooks that are created specifically for the shelly plus i4 that can control my Philips hue bridge?

eurich commented

just check https://github.com/shelly-tools/shelly-script-examples, there are various examples how to control HuE Bulbs ..

@eurich Where can I find the our scripts or webhooks created specifically for Shelly Plus i4. that are referenced in the marketing materials?

@JensTimmerman did you find some scripts about the Shelly Plus i4?
I am also struggling with scripting...

@WolfiFromFinland I wrote some myself, but I'm still looking for the scripts that are promised here in the marketing copy

@WolfiFromFinland I created this simple script to switch the lights states in hue bridge, can be expanded upon,
I need to add some timing code to check for double/tripple taps and holds of the buttons

// CONFIG START
let CONFIG = {
    ip: '192.168.1.XX', //Hue Bridge IP
    user: 'XXX-XXX', //Hue Bridge API token/user get this by following https://developers.meethue.com/develop/get-started-2/
    lights: {'0': '37', '1': '36', '2': '32', '3': '33'}, // mapping from button to Hue Light ID to control
};
// CONFIG END

Shelly.addStatusHandler(function (e) {
        print(e)
        light = CONFIG.lights[e.delta.id]
        if (light == 'undefined' || ! e.delta.state ) {
          return // only proceed on press of a button
        }
        Shelly.call(
            "http.request", {
            method: "GET",
            url: 'http://' + CONFIG.ip + '/api/' + CONFIG.user + '/lights/' + light,  // get current light state from hue
        },
            function (res, error_code, error_message, ud) {
                let st = JSON.parse(res.body);
                  Shelly.call("http.request", {
                   method: "PUT",
                   url: 'http://' + CONFIG.ip + '/api/' + CONFIG.user + '/lights/' + light + '/state',
                   body: '{"on": ' + !st.state.on + '}' // toggle light state
                  },
                     function (r, e, m) {},null);
            },
            null
        );
});

Thanks a lot @JensTimmerman - very helpful! I got a few ideas on how to continue.

@WolfiFromFinland Hello, did you success with the script? Do you need any help?

If its ready could you open a PR with all sensitive info wiped out so everyone who is looking for such an example, can use it?

Hello, I'm new to this and I was wondering if there is any noticeable latency using a shelly i4 to control hue VS using a shelly dimmer2 to control a dumb bulb (which is a self contained wired connection basically). Thank you.