Pushover: Sending message to specified user/device

Domotica gratuit Forums How can I …? Synology NAS Pushover: Sending message to specified user/device

Ce sujet a 11 réponses, 3 participants et a été mis à jour par  djandib, il y a 5 mois et 1 semaine.

12 sujets de 1 à 12 (sur un total de 12)
  • Auteur
    Messages
  • #3580

    djandib
    Participant

    Hi!
    As I read here: https://pushover.net/api it`s possible to send messages to specified devices.
    Unfortunately in the Pulse-Station Blockly for Pushover I don`t see this possibility.
    Is there a workaround?

    Why I need this?
    As long as I work on new scences, I don`t want to receive the test-messages at all devices, but only e.g. at my mobile… (My wife got angry with me, because the got all messages at her mobile too ;-))

    Thanx
    Andi

    #3584
    Miss Laura
    Miss Laura
    Modérateur

    Hi,

    You can use a blocky custom PHP block to send the Pushover messages in a custom way.

    Example code:

    <?php
    curl_setopt_array($ch = curl_init(), array(
      CURLOPT_URL => "https://api.pushover.net/1/messages.json",
      CURLOPT_POSTFIELDS => array(
        "token" => "APP_TOKEN",
        "user" => "USER_KEY",
        "message" => "hello world",
      ),
      CURLOPT_SAFE_UPLOAD => true,
    ));
    curl_exec($ch);
    curl_close($ch);

    You can then set custom parameters any way you prefer 🙂

    Have fun,
    Laura

    #3593

    djandib
    Participant

    Thanx a lot

    #3594
    Miss Laura
    Miss Laura
    Modérateur

    Did you manage to get it to work?
    Feel free to share the code back 🙂

    Have fun,
    Laura

    #3596

    djandib
    Participant

    yes.
    It´s exactly like you said:
    ***
    curl_setopt_array($ch = curl_init(), array(
    CURLOPT_URL => “https://api.pushover.net/1/messages.json”,
    CURLOPT_POSTFIELDS => array(
    “token” => “APP_Token”,
    “user” => “USER_KEY”,
    “device” => “DJ-mobile”,
    “sound” => “alien”,
    “message” => “Test”,
    ),
    CURLOPT_SAFE_UPLOAD => true,
    ));
    curl_exec($ch);
    curl_close($ch);

    ****
    APP_Token = Your APP-Key from https://pushover.net/apps/
    User_key = Your User-KEy from https://pushover.net/
    device = Device-Name from https://pushover.net/
    sound = from https://pushover.net/api#sounds

    @Laura:
    Maybe you can pimp the Pushover-Blockly with “device” as a free field for the next update?
    🙂

    #3597
    Miss Laura
    Miss Laura
    Modérateur

    Great, tx!
    Added to the ideas list.

    Have fun,
    Laura

    #4039

    djandib
    Participant

    Hi Laura,
    anything new about this topic?

    Andi

    Btw: in the sound DDL “none” is missing, too.

    #4041

    K.Rens
    Admin bbPress

    Hi Djandib,

    I’ve looked into the code and:
    It’s compiled and encrypted, I cannot change it

    This means I cannot add the sound and I cannot add a device specific message.

    What I can do is completely rewrite it from scratch, which shouldn’t be too difficult, it just takes time.

    I’m only now starting to figure out how to add custom blocky blocks inside PulseStation, so I can get started on that as well.

    Nothing I can’t solve, just takes a lot more time for a free hobby project.

    Kind regards,
    K.Rens

    #4045

    djandib
    Participant

    Thanx for answer.

    Unfortunately I cannot programm Blocky until now….
    So in that point I cannot help you 🙁

    #4053

    K.Rens
    Admin bbPress

    But it works with the custom php blocky block, right?
    You should be able to already do all you want untill we rewrite the full code?

    Kind regards,
    K.Rens

    #4143

    djandib
    Participant

    Hi Koen,
    I took a little workaround:
    1) Calling Scene:
    Setting

    2) Called Scene
    Called Scene

    Unfortunately Pulse-Station “forgets” the variables, so I have to save them for using them at the called Scene.

    Andi

    #4144

    djandib
    Participant

    Koen told me that he uses for this the virtual devices LOV. With them you can use up to 4 values.
    I think this should be another way:
    1) Create a virtual LOV device (e.g. “Pushover”)
    2) Calling Scene:
    Calling Scene
    3) Called Scene:
    CalledScene

    Feel free to give some comments.

    Andi

12 sujets de 1 à 12 (sur un total de 12)

Vous devez être connecté pour répondre à ce sujet.