Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Domoticz
  4. How to send serial commands (v_var) from Domoticz to serial gateway

How to send serial commands (v_var) from Domoticz to serial gateway

Scheduled Pinned Locked Moved Domoticz
2 Posts 2 Posters 2.5k Views 2 Watching
  • 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.
  • I Offline
    I Offline
    Inso
    wrote on last edited by Inso
    #1

    Hi,

    I´m working on this for days now, with no conclusion.

    I´d like to send commands to my Arduino Gateway from Domotics, using my DzVents script.
    As the commands won´t fit predefinded types, I´d like to use the v_var1 - 5 (as shown on the list on https://www.mysensors.org/download/serial_api_20#set,-req)
    I found the json url commands
    (https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's),
    and also an example
    (on https://forum.mysensors.org/topic/4933/using-the-selector-switch-in-domoticz-tutorial/2 ) :

    http://192.168.2.110:8080/json.htm?type=command&param=switchlight&idx=971&switchcmd=Set%20Level&level=0
    

    Set f.e. to a virtual dimmer switch, I can now read the command on the Arduino sketch

    message.type == V_PERCENTAGE
    

    and get the value sended.

    My problem is, I can´t find out why "param=switchlight" on Domotics results in "V_PERCENTAGE" on MySensors. And what I have to send to get the "V_VAR1".

    Mayber there is also an easier way to send commands to MySensors - maybe send serial commands directly?

    Gateway (and also Domoticz server) is an RPi3.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      iahim67
      wrote on last edited by
      #2

      @Inso - you can eventually register a few TEXT devices with one of your Arduino sensors, like:

      present(LCD_LINE1_CHILD_ID, S_INFO, LCD_LINE1);
      

      then periodically ask data back from Domoticz like:

        if (!line1received) {
          request(LCD_LINE1_CHILD_ID, V_TEXT);
      #if DEBUG == 1
          Serial.println("Requested line1 from gw !");
      #endif
          wait(5000, 2, V_TEXT); // wait for 5s or until a message of type V_TEXT is received
        }
      

      just define this first:

      bool line1received = false;
      

      For more details on the DzVents (2.4x) side have a look in the Domoticz installation folder, there are a few good DzVents examples, this is the path in Windows7:
      C:\Program Files (x86)\Domoticz\scripts\dzVents\examples

      Hope it helps ...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      16

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular