Difference in Gen1 API and Gen2?

  • Hello,

    I have a simple question. When comparing the HTTP Requests in the Gen1 and Gen2 API doc for switching a relay, it's like http://yourIP/relay/0?turn=on&timer=10.

    The Gen2 API offers the same HTTP request, but the timer parameter behaves differently. While in Gen1, that's a fallback timer in seconds, so after 10 seconds, the switch will fall back, in Gen2 this is an execution delay and in ms. Therefore, the API looks similar, but the behavior of the "timer" parameter is completely different.

    I don't have a Gen2 device yet, therefore I can't test it. I am just curious whether that is an intentional API change, although in the Gen2 documentation the HTTP Endpoints were mentioned for backward compatibility....

    I actually like the behavior of the Gen2 API and I look forward testing it as soon as my Gen2 Device arrives....

    I am looking forward reading your thoughts,

    Regards

  • Well, I have an 3EM, which behaves exactly as described here (https://shelly-api-docs.shelly.cloud/gen1/#shelly-3em-relay-0). As you can read in the documentation, it is a "one-shot flip back", and that is whats happening, the switch flips back to "off" when I execute the URL as mentioned after 10 seconds, so at least the Gen1 documentation is consistent.

    As said, I don't have a Gen2 device, but the doc clearly states differently (https://shelly-api-docs.shelly.cloud/gen2/Component…ndpoint-relayid). Here it states: "Time in ms until the request is executed. Optional". Therefore the behaviour in the documentation is clearly different. That's why I am asking. Either there is really a difference and the documentation is correct, or the behavior is the same, then the documentation is wrong and needs to be fixed :D

    Regards

  • I'm guessing 2. and the documentation is wrong at this point. It needs to be corrected. Gen2 devices really behave like the gen1 devices here (which is a good thing)

  • Bummer.... I liked the "execution delay", as this is what I need. The "flip back" is useless for me :-D.

    I ordered my Pro 4PM today, and will test exactly this as soon as it arrives and let you (and everybody who reads here) know, what's implemented.

  • Dieses Thema enthält 3 weitere Beiträge, die nur für registrierte Benutzer sichtbar sind, bitte registrieren Sie sich oder melden Sie sich an um diese lesen zu können.