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. Development
  3. On the go timer interrupts?

On the go timer interrupts?

Scheduled Pinned Locked Moved Development
3 Posts 2 Posters 1.2k 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.
  • Sergio RiusS Offline
    Sergio RiusS Offline
    Sergio Rius
    wrote on last edited by
    #1

    Hi.
    I don't have so much experience in C++ so I don't know if it will be possible.
    What I want is, at the moment I receive the order from the controller to switch on a light, if the light has a preset time running, create a timer interrupt at the end of the said period to turn that light off.
    I would like those interrupt to be independant and generated, so if I have two lights, would behave the same.

    Do you think that is possible?
    Thx!

    T 1 Reply Last reply
    0
    • Sergio RiusS Sergio Rius

      Hi.
      I don't have so much experience in C++ so I don't know if it will be possible.
      What I want is, at the moment I receive the order from the controller to switch on a light, if the light has a preset time running, create a timer interrupt at the end of the said period to turn that light off.
      I would like those interrupt to be independant and generated, so if I have two lights, would behave the same.

      Do you think that is possible?
      Thx!

      T Offline
      T Offline
      TheoL
      Contest Winner
      wrote on last edited by
      #2

      @Sergio-Rius It is possible even without interrupts. But I think this kind of logic should be put in the controller. It saves you the coding and leaves the solution flexible.

      So you create an on/off sensor. And just add a timer in the controller. Domoticz supports this without using scripting.

      Sergio RiusS 1 Reply Last reply
      0
      • T TheoL

        @Sergio-Rius It is possible even without interrupts. But I think this kind of logic should be put in the controller. It saves you the coding and leaves the solution flexible.

        So you create an on/off sensor. And just add a timer in the controller. Domoticz supports this without using scripting.

        Sergio RiusS Offline
        Sergio RiusS Offline
        Sergio Rius
        wrote on last edited by
        #3

        @TheoL Hi.
        I think that a higher level of abstraction from the controller, and giving the node more personality suits better for me. Also I like reducing the unnecessary radio traffic.

        Let me explain something more my node. The node I'm working on it's basically a multiple actuator that abstracts from the code things like the number of relays or their behaviour.
        At the moment, you are forced to populate a collection for it to discover and work with a variable number of elements, but as soon as I can I'll find a way to inject that info and avoid altering the code. Perhaps something like espeasy does, rflink activates it's rf modules, or even through a variable from the controller (worst of cases)

        Now it does all those things but the timer shutdown. I'm a good C# programmer, but I admit that it'll be difficult for me to adapt to C++. I still do all the things as I was doing in C#
        I don't know anything about the scope or the behaviour of instantiated objects. I would like to tie a timer object to one element's property in the collection and let it run, but I don't know how, or if it will stay "alive" after the procedure ends :smirk:

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        15

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        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