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. Light level sensor add to Domoticz

Light level sensor add to Domoticz

Scheduled Pinned Locked Moved Domoticz
4 Posts 2 Posters 3.3k Views 1 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.
  • DickD Offline
    DickD Offline
    Dick
    wrote on last edited by Dick
    #1

    I created a light_level sensor and now I want to use it as a sensor in Domoticz (use it to turn the lights on on an certain light level). I have no clue how get it in place. I read about the creation of a dummy hardware, what I did. Now I don't know anymore. The light level sensor is already visible in the device list of domoticz.

    1 Reply Last reply
    0
    • sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #2

      You dont need a dummy switch - you need a switch that controlls your light. Then you create some rules either in LUA or in blockly.
      Here is my light scripts from LUA (my lightlevel is named utomhusljus and my group with windowlights is called "fonsterlampor"):

      commandArray = {}
      v = tonumber(otherdevices_svalues['Utomhusljus'])
      
      if  (v <= 30)) then 
      commandArray['Group:Fonsterlampor']='On'
      end
      
      return commandArray
      

      You need to code it more than this, (for example they should not be turned off after midnight or when you go to sleep) so you might need to add more variables, like current time or something.

      For example this will turn on the group "Fonsterlampor" but not later than 21:50 or earlier than 4:59:

      commandArray = {}
      v = tonumber(otherdevices_svalues['Utomhusljus'])
      h = tonumber((os.date('%H')))
      
      if  (v <= 30 and h < 22 and h >= 5) then 
      commandArray['Group:Fonsterlampor']='On'
      end
      
      return commandArray
      

      You can also use blockly as I said. It should be easier, you find it in the menu but I have no knowledge about that. Google domoticz blockly tutorial or something.

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      DickD 1 Reply Last reply
      0
      • sundberg84S sundberg84

        You dont need a dummy switch - you need a switch that controlls your light. Then you create some rules either in LUA or in blockly.
        Here is my light scripts from LUA (my lightlevel is named utomhusljus and my group with windowlights is called "fonsterlampor"):

        commandArray = {}
        v = tonumber(otherdevices_svalues['Utomhusljus'])
        
        if  (v <= 30)) then 
        commandArray['Group:Fonsterlampor']='On'
        end
        
        return commandArray
        

        You need to code it more than this, (for example they should not be turned off after midnight or when you go to sleep) so you might need to add more variables, like current time or something.

        For example this will turn on the group "Fonsterlampor" but not later than 21:50 or earlier than 4:59:

        commandArray = {}
        v = tonumber(otherdevices_svalues['Utomhusljus'])
        h = tonumber((os.date('%H')))
        
        if  (v <= 30 and h < 22 and h >= 5) then 
        commandArray['Group:Fonsterlampor']='On'
        end
        
        return commandArray
        

        You can also use blockly as I said. It should be easier, you find it in the menu but I have no knowledge about that. Google domoticz blockly tutorial or something.

        DickD Offline
        DickD Offline
        Dick
        wrote on last edited by
        #3

        Thank you to give me a push in the right direction. I gonna use Blocky.
        Have a nice day and I can go on with my build

        1 Reply Last reply
        0
        • DickD Offline
          DickD Offline
          Dick
          wrote on last edited by
          #4

          I read about blocky for domoticz. It looks easy but my first steps are not so easy. I opened in "more options" the option "events", in events I select a "Control" (if/Do), also a "Logic" (>-), a "device " (temperature). In this beginning fase I am not able to connect temp device to the Logic. Anybody recognize this?

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


          17

          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