• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    EVOK and websockets

    Official EVOK API
    2
    3
    1904
    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.
    • L
      lukec last edited by

      Hi,

      I am running raspbian jessie recently and I cannot figure out websockets. I can not change relay states trough websocket connection (whic has state connected, aslo if I use websockets as input it works)

      I created simple flow (which gives me trouble):

      [{"id":"c19d5eed.d773c","type":"inject","z":"a5e9eb30.633008","name":"unipiR2on","topic":"unipiR2on","payload":"{\"dev\":\"relay\", \"circuit\":\"2\", \"value\":\"1\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":372,"y":338,"wires":[["d9c4b8fa.078788","af5dc7d8.1bc2e8"]]},{"id":"bad348d9.50a668","type":"inject","z":"a5e9eb30.633008","name":"unipiR2off","topic":"unipiR2off","payload":"{\"dev\":\"relay\", \"circuit\":\"2\", \"value\":\"0\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":382.9000434875488,"y":480.5667152404785,"wires":[["d9c4b8fa.078788","af5dc7d8.1bc2e8"]]},{"id":"d9c4b8fa.078788","type":"debug","z":"a5e9eb30.633008","name":"","active":true,"console":"false","complete":"payload","x":696.0477447509766,"y":179.5238332748413,"wires":[]},{"id":"af5dc7d8.1bc2e8","type":"websocket out","z":"a5e9eb30.633008","name":"","server":"d4a09910.dd7638","client":"","x":778.8095528738838,"y":395.23812430245533,"wires":[]},{"id":"d4a09910.dd7638","type":"websocket-listener","z":"","path":"ws://127.0.0.1/ws","wholemsg":"false"}]
      
      T 1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators @lukec last edited by

        @lukec Please try to add also a paramater "cmd":"set" to the message and le me know. I have to update the example since the API has changed a little bit.

        1 Reply Last reply Reply Quote 0
        • L
          lukec last edited by lukec

          True, if "cmd":"set" addet to json string, ws command works.

          Reliability of ws is not as expected - bmo it is beter to use http post methods.

          ps.
          Can you please tell what are other commands in cmd?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post