Use a BLU1 to control a Plus 2PM directly over BT

  • Hello All,

    I have a roller shutter before my front door. It is controlled now by a Shelly 2,5 in roller mode, with a pushbutton inside the house.

    This means that I depend on WIFI being online to open the shutter from the outside.

    To avoid needing the WIFI, I bought a few BLU1 buttons and a Gen2 Shelly 2PM. The 2PM is paired with the BLU1, and transmits the BLU1 info to the app so that works fine

    I also found a script that detects the button being single or double pressed and displays that on the script console, and emits an event. But the event goes over WIFI.

    Now I want that button to control the 2PM directly, but all I find in the API are webhook based commands.

    Has anybody any ideas ?

  • Events are only local on the device, not inside your wifi, what you need inside your skript is an event handler and some cover shelly call commands.

    Cover | Shelly Technical Documentation
    The Cover component handles the operation of motorized garage doors, window blinds, roof skylights etc. It uses Cover as RPC namespace and provides the methods:
    shelly-api-docs.shelly.cloud
    How to use scripting in Shelly?
    This is my first try understanding and working on some examples in Shelly scripting. I think I did quite a lot already showing what is possible, but there ar...
    www.youtube.com
  • OK... Meanwhile I downloaded your event handling script (from 10 may), thanks a lot.

    I suppose I could insert the cyclic control logic for the cover in that script .

    Or make an event handler script responding to your Shelly.emitEvent. That seems more appropriate.

  • Exactly :thumbup: Do not forget to filter for your blu mac ID in your event filter logic, so that only your own blu device controls your covers. (You can find your blu Mac ID inside the event object))

    If you're in a jam or desperately need help, I'd be happy to lend a hand. Unfortunately, I don't own a plus2PM, so I don't have any cover scripts. By the way, it would be great if you could share your finished skript with this forum, there will be other users who are looking for a way to control their covers with a blu, so your skript could save them some time. :beer:

    Maybe this will help you a bit, here is a Cover Shelly 2.5 remote control script, you can`t just use it 1 to 1 as plus2pm needs different commands.

    shelly-script-examples/emulate_shutter_cycleswitch.js at main · shelly-tools/shelly-script-examples
    Shelly mJS Scripting examples. Contribute to shelly-tools/shelly-script-examples development by creating an account on GitHub.
    github.com

    6 Mal editiert, zuletzt von _[Deleted]_ (29. Mai 2023 um 22:22)

  • OK... Meanwhile I downloaded your event handling script (from 10 may), thanks a lot.

    I encountered a bug in my BT Scanner Script, the old skript still works fine its its just an minor think. Anyhow it turns out that the Shelly developers recently introduced a new button event called 'hold_push' with an ID of 254. I wasn't anticipating any button IDs exceeding 20.

    However, I have already resolved this issue in an new version of my script. The updated version is now prepared for future updates, and any unrecognized button events or IDs will be treated as 'unknown_push' events.

    If you have any further questions or concerns, feel free to let me know.

    _[Deleted]_
    10. Mai 2023 um 20:46