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. Presenting and controlling variables in domoticz

Presenting and controlling variables in domoticz

Scheduled Pinned Locked Moved Domoticz
4 Posts 2 Posters 1.4k 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
    iguaan
    wrote on last edited by
    #1

    Hello,

    having trouble controling multiple actuators in domoticz.
    I have made arduino sketch with preloaded setpoints for outside light controlling, in case domoticz is offline or unreachable after power outage etc.
    I have switch on/off setpoints and time delay for switch off

    When i activate present(RGB_RGBChild, S_RGB_LIGHT, "Ees RGB valik") then also time-delay is automatically adjusted by it.

    MyMessage msgTe1(CHILD_ID_Te1, V_TEMP);
    MyMessage msgSp21(CHILD_ID_Sp21, V_HVAC_SETPOINT_HEAT);         //seadearvu muutmine kaugelt
    MyMessage msgSp22(CHILD_ID_Sp22, V_HVAC_SETPOINT_COOL);
    MyMessage msgvalgus(CHILD_ID_valgus, V_LEVEL);
    MyMessage msgaeg2(CHILD_ID_aeg2, V_PERCENTAGE);
    
    void presentation()  {
      sendSketchInfo("Valgus", "1.0");  // seadme nimi, versioon domoticzile
      present(CHILD_ID_Te1, S_TEMP, "Pooningul");        //anname anduri id, liigi, nime domoticzile
      present(CHILD_ID_valgus, S_LIGHT_LEVEL, "Valgustugevus"); //current level lux
      present(CHILD_ID_Sp21, S_LIGHT_LEVEL, "Valgus sisse"); // light on
      present(CHILD_ID_Sp22, S_LIGHT_LEVEL, "Valgus valja"); // light off
      present(CHILD_ID_aeg2, S_DIMMER, "Valguse viide valja");  // time delay off 
    

    When i added ws2812 RGB switch everything got mixed up, especially time delay feature, but also switching in domoticz activated CHILD_ID_Sp21 and CHILD_ID_Sp22(no values were changed)

    MyMessage msgTe1(CHILD_ID_Te1, V_TEMP);
    MyMessage msgSp21(CHILD_ID_Sp21, V_HVAC_SETPOINT_HEAT);         //seadearvu muutmine kaugelt
    MyMessage msgSp22(CHILD_ID_Sp22, V_HVAC_SETPOINT_COOL);
    MyMessage msgvalgus(CHILD_ID_valgus, V_LEVEL);
    MyMessage msgaeg2(CHILD_ID_aeg2, V_PERCENTAGE);
    
    
    
    MyMessage lightRGBMsg(RGB_LightChild,  V_RGB);        // standard messages, light
      MyMessage lightdimmerMsG(RGB_LightChild ,V_DIMMER); 
    MyMessage lightOnOffMessage(RGB_LightChild, V_STATUS);
    
    void presentation()  {
      sendSketchInfo("Valgus", "1.0");  // seadme nimi, versioon domoticzile
      present(CHILD_ID_Te1, S_TEMP, "Pooningul");        //anname anduri id, liigi, nime domoticzile
      present(CHILD_ID_valgus, S_LIGHT_LEVEL, "Valgustugevus"); //current level lux
      present(CHILD_ID_Sp21, S_LIGHT_LEVEL, "Valgus sisse"); // light on
      present(CHILD_ID_Sp22, S_LIGHT_LEVEL, "Valgus valja"); // light off
      present(CHILD_ID_aeg2, S_DIMMER, "Valguse viide valja");  // time delay off 
    
      present(RGB_RGBChild, S_RGB_LIGHT, "Ees RGB valik");// present to controller
      present(RGB_LightChild, S_LIGHT, "Ees on/off/dim ");
      present(RGB_SolidColorChild, S_LIGHT, "Ees on/off värv" );
      present(RGB_TextColorChild, S_INFO, "Ees värvi tekst" );  
      present(RGB_AlarmPatternChild, S_BINARY, "Ees vilkuv pu/va" );
      present(RGB_NextPatternChild, S_DIMMER, "Ees RGB muster" );
    

    Each child is presented in domoticz correctly with correct name.
    Is there even a way to use multiple same type actuators in a sketch?

    To update preloaded setpoints from arduino to domoticz, i have this added (which might be the problem?)

    void receive(const MyMessage &message) {
    
      if (message.type == V_HVAC_SETPOINT_HEAT) {
        Sp21 = message.getFloat();
      }
      if (message.type == V_HVAC_SETPOINT_COOL) {
        Sp22 = message.getFloat();
      }
    
      if (message.type == V_PERCENTAGE) {
        aeg2 = message.getFloat();
      }
      sendNewStateToGateway();
    

    and

    void sendNewStateToGateway() {
    
      send(msgSp21.set(Sp21));
      send(msgSp22.set(Sp22));
      send(msgaeg2.set(aeg2));
    
    }
    

    Have googled and searched mysensors/domoticz forums but no results. I'm more like hobby programmer if that's the word and self somewhat learned by google for a few years now.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pjr
      wrote on last edited by
      #2

      Cannot get the point what you exactly mean but I think you should check for what child the message is for:
      if(message.sensor == CHILD_ID_aeg2 && message.type == ...) { ..do suff.. }

      I 1 Reply Last reply
      1
      • I Offline
        I Offline
        iguaan
        wrote on last edited by
        #3

        I cannot use multiple V_PERCENTAGE values. Because if a change a value in domo, both are changing (dime delay(aeg2)) and RGB dimmer..

        1 Reply Last reply
        0
        • P pjr

          Cannot get the point what you exactly mean but I think you should check for what child the message is for:
          if(message.sensor == CHILD_ID_aeg2 && message.type == ...) { ..do suff.. }

          I Offline
          I Offline
          iguaan
          wrote on last edited by
          #4

          @pjr said in Presenting and controlling variables in domoticz:

          Cannot get the point what you exactly mean but I think you should check for what child the message is for:
          if(message.sensor == CHILD_ID_aeg2** && message.type == ...) { ..do suff.. }

          Thank you, message.sensor was the thing i needed. Browsed cpp and h files in mysensors library and googled, but couldn't find variables to use with message.*.
          :smiley:

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


          24

          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