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. Is this scenario possible using domoticz?

Is this scenario possible using domoticz?

Scheduled Pinned Locked Moved Domoticz
4 Posts 4 Posters 3.5k Views 4 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.
  • Cliff KarlssonC Offline
    Cliff KarlssonC Offline
    Cliff Karlsson
    wrote on last edited by
    #1

    I have been planning to build/use a sensor with domoticz but my skills are pretty limited. But I am wondering if this is possible:

    I have a sensor whish can output four different values depending on how the sensor is triggered, how do I send four different values to domoticz and what sensor type do I chose? I want in this example be able to light up four different lightbulbs in domoticz depending on the sensoroutput.

    I would also want to be able to use a local variable and a global variable. Can I somehow "push" a variable from domoticz to the sensor everytime it changes?

    K dbemowskD P 3 Replies Last reply
    0
    • Cliff KarlssonC Cliff Karlsson

      I have been planning to build/use a sensor with domoticz but my skills are pretty limited. But I am wondering if this is possible:

      I have a sensor whish can output four different values depending on how the sensor is triggered, how do I send four different values to domoticz and what sensor type do I chose? I want in this example be able to light up four different lightbulbs in domoticz depending on the sensoroutput.

      I would also want to be able to use a local variable and a global variable. Can I somehow "push" a variable from domoticz to the sensor everytime it changes?

      K Offline
      K Offline
      kimot
      wrote on last edited by
      #2

      @Cliff-Karlsson
      I think it will be a problem send data from Domoticz to MySensors.
      I do not know any command in Domoticz.
      But if you use another hardware and sw, witch accepts http requests, for example ESP2866 with ESPeasy,
      it is possible.
      I use new dzVent script like this to send thermostat setpoint to my device every time, when is changed.

      return {
      	active = true, -- set to false to disable this script
      	on = {
      		devices = {
      			'Vychod_Setpoint'
      		}
      	},
      	execute = function(domoticz, device)
      	    local url= 'http://192.168.XXX.XXX/control?cmd=event,HeatSetpoint='..(device.state)..''
                  print(url)
                  domoticz.openURL(url)
              
      	end
      

      Instead of "devices" you can use "variables" to call script when Domoticz user variable changes.

      When you want send data to Domoticz:

      http://<username:password@>domoticz-ip<:port>/json.htm?type=command&param=switchlight&idx=99&switchcmd=On
      

      you switch On switch with idx 99

      This way you can send almost everything.

      For example power consumption 660W:

      http://<username:password@>domoticz-ip<:port>/json.htm?type=command&param=udevice&idx=28&nvalue=0&svalue=660;0
      

      The same Domoticz script with traditional LUA:

      commandArray = {}
              if devicechanged['Vychod_Setpoint'] then
                  DomDevice = 'Vychod_Setpoint'
                  DomValue = otherdevices_svalues[DomDevice]
                  CalcValue = (DomValue*1)
                  print(CalcValue)
                  url= 'http://192.168.XXX.XXX/control?cmd=event,HeatSetpoint='..(CalcValue)..''
                  print(url)
                  commandArray['OpenURL']= url
              end
      return commandArray 
      
      1 Reply Last reply
      0
      • Cliff KarlssonC Cliff Karlsson

        I have been planning to build/use a sensor with domoticz but my skills are pretty limited. But I am wondering if this is possible:

        I have a sensor whish can output four different values depending on how the sensor is triggered, how do I send four different values to domoticz and what sensor type do I chose? I want in this example be able to light up four different lightbulbs in domoticz depending on the sensoroutput.

        I would also want to be able to use a local variable and a global variable. Can I somehow "push" a variable from domoticz to the sensor everytime it changes?

        dbemowskD Offline
        dbemowskD Offline
        dbemowsk
        wrote on last edited by
        #3

        @Cliff-Karlsson Can you elaborate a little more on your project? What sensor type you choose would depend on what kind of sensor it is. Since you didn't tell us what that is, we can't very well recommend what type of sensor to choose.

        There are ways to send data to a MySensors device using LUA script, but again, not knowing what you are trying to do makes it hard to help.

        Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
        Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

        1 Reply Last reply
        0
        • Cliff KarlssonC Cliff Karlsson

          I have been planning to build/use a sensor with domoticz but my skills are pretty limited. But I am wondering if this is possible:

          I have a sensor whish can output four different values depending on how the sensor is triggered, how do I send four different values to domoticz and what sensor type do I chose? I want in this example be able to light up four different lightbulbs in domoticz depending on the sensoroutput.

          I would also want to be able to use a local variable and a global variable. Can I somehow "push" a variable from domoticz to the sensor everytime it changes?

          P Offline
          P Offline
          pjr
          wrote on last edited by pjr
          #4

          @Cliff-Karlsson said in Is this scenario possible using domoticz?:

          I have a sensor whish can output four different values depending on how the sensor is triggered, how do I send four different values to domoticz and what sensor type do I chose? I want in this example be able to light up four different lightbulbs in domoticz depending on the sensoroutput.

          I have done this with my heat pump controller. I'm using dimmer and "linking" that to dummy selector what contains the states(0=off, 10=heat by water, 20=heat by room, 30=freeze protection...).
          Linking is done with LUA:

          --
          -- Heat pump mode selector<>dimmer mapping event
          --
          
          commandArray = {}
          
          selectorName = 'Pumppu_Mode'
          selectorId = '332'
          dimmerName = 'Pumppu_ModeSW2'
          
          -- selector -> native
          if(devicechanged[selectorName]) then
            iDimLevel = tonumber(otherdevices_svalues[selectorName])
            commandArray[dimmerName]='Set Level '..iDimLevel
          end
          
          -- native -> selector. (not triggering events this way of calling with UpdateDevice)
          if (devicechanged[dimmerName]) then
            if (devicechanged[dimmerName] == 'Off') then
              commandArray['UpdateDevice'] = selectorId..'|0|0'
            else
              iCurrentDimLevel = 0
              if(otherdevices[dimmerName] == 'On') then -- can be "On" or something else
                iCurrentDimLevel = tonumber(otherdevices_svalues[dimmerName])
              else
                iCurrentDimLevel = tonumber(string.match(otherdevices[dimmerName], "Set Level: (%d+) %%"))
              end
              
              commandArray['UpdateDevice'] = selectorId..'|'..iCurrentDimLevel..'|'..iCurrentDimLevel
            end
          end
          
          return commandArray
          

          I would also want to be able to use a local variable and a global variable. Can I somehow "push" a variable from domoticz to the sensor everytime it changes?

          Create a device to your sketch and use that to handle the "variable". The rest is just scripting in domoticz after that.

          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