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. Trying to automate in Domoticz

Trying to automate in Domoticz

Scheduled Pinned Locked Moved Domoticz
4 Posts 3 Posters 47 Views 3 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.
  • Feliw05F Offline
    Feliw05F Offline
    Feliw05
    wrote on last edited by
    #1

    Hello everyone, I just started with mysensors, I have successfully connected a serial gateway and a node that measures temperature. I'm now trying to automate on domoticz so that I can get notifications and other things of my node. I am trying to learn dzVents in the domoticz wiki:(https://www.domoticz.com/wiki/DzVents:_next_generation_Lua_scripting)
    The problem is that When I save and run the Quickstart code with the name of my switch the log only shows that it has been turn on and doesnt show my log message.
    return {
    on = {
    devices = {
    'switch'
    }
    },
    execute = function(domoticz, switch)
    if (switch.state == 'On') then
    domoticz.log('Hey! I am on!')
    else
    domoticz.log('Hey! I am off!')
    end
    end
    }
    }

    I have already set the local network to 127.0.0.1 and enabled dzVents.
    Does anyone now what is happening?

    1 Reply Last reply
    0
    • boumB Offline
      boumB Offline
      boum
      wrote on last edited by
      #2

      First, make sure your switch is really named 'switch', the scripts are case sensitive, so neither 'Switch' nor 'SWITCH' will work. Also, verify you don't have a trailing space in the name ('switch ').
      To check your script is run when the device is changed, add a domoticz.log first line in the execute function.
      Hope this helps.

      1 Reply Last reply
      1
      • Feliw05F Offline
        Feliw05F Offline
        Feliw05
        wrote on last edited by
        #3

        @boum sadly it didnt work :( I made sure that the name of the switch was well written and I added a domoticz.log with a message inside the function and it didnt work.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MHofer
          wrote on last edited by
          #4

          the problem is "if (switch.state == 'On') then" that not works, write:

          if (switch.active) then
          

          or

          if (switch.inActive) then
          

          Device attributes and methods for all devices

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


          14

          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