• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login

REST API for smart sleep enabled nodes

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 421 Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    mtiutiu
    last edited by mtiutiu 18 Apr 2019, 06:48

    Hi,

    @jkandasa First of all great work! I really like this project and its simplicity. I'm sorry if I double post this but I have one simple question - when doing REST API calls to send messages to a specific node/sensor id does this work for sleeping nodes?
    I'm asking this because I tried yesterday to perform a REST API call using the sendRawMessage endpoint for a smart sleep enabled node and I noticed that it doesn't work all the time (I used your example from here). I mean sometimes it got the message but most of the times it didn't. I also have a custom widget on the dashboard for controlling it which was creating using this tutorial and it works all the time. Now I don't know how much the two are related behind the scenes but by using the REST API it seems not so reliable for me.

    Is there another way of accomplish this or am I missing something here?
    Or in another words is the sendRawMessage endpoint aware of smart sleep enabled sensors (if this makes sense) ?

    Forgot to mention - I'm using the MySensors back-end with a serial gateway and MyController version: 1.4.0.

    Thank you for your help.

    J 1 Reply Last reply 23 Apr 2019, 07:14 Reply Quote 0
    • J Offline
      jkandasa @mtiutiu
      last edited by 23 Apr 2019, 07:14

      @mtiutiu Seems sendRawMessage not using/sensing sleeping node(need to confirm by checking the code.)

      The following API using sleeping node logic,

      PUT: https://enveedu.mycontroller.org/mc/rest/sensors/updateVariable

      You can get the sensor variable id by editing the sensor variable.

      Payload:
      {
        "id":1186,
        "value":1
      }
      
      M 1 Reply Last reply 23 Apr 2019, 11:40 Reply Quote 0
      • M Offline
        mtiutiu @jkandasa
        last edited by 23 Apr 2019, 11:40

        @jkandasa

        That's what I did in the end as a "workaround" and it works. I don't like this approach very much because I have to inspect what id I need to use as it seems to be different from the real node sensor id.
        It would be nice to have that working using the sendRawMessage endpoint also. I can open an issue on Github if needed.

        Thanks.

        J 1 Reply Last reply 23 Apr 2019, 16:14 Reply Quote 0
        • J Offline
          jkandasa @mtiutiu
          last edited by 23 Apr 2019, 16:14

          @mtiutiu said in REST API for smart sleep enabled nodes:

          It would be nice to have that working using the sendRawMessage endpoint also. I can open an issue on Github if needed.

          Yes, please open a ticket. I will check and update you. Thanks!

          1 Reply Last reply Reply Quote 0
          1 out of 4
          • First post
            1/4
            Last post

          0

          Online

          624

          Users

          531

          Topics

          3.4k

          Posts
          Copyright © 2015-2025 MyController.org | Contributors | Localization