Relay with Actuator issues


  • Hardware Contributor

    I'm having some issues yet again with my custom made light switch node. My current setup is a custom board with a relay on board and a switch, that is running the "RelayWithActuator" sketch, and this is working perfect with the on board switch and from the web interface of OpenHAB.

    I have then made a light switch that is basically the button sketch. It takes the input of a button being pressed (light switch faceplate) and then sends that to openhab. Perfectly fine in itself. However, i then light the two together using a rule inside of OpenHAB to toggle the relay board whenever the button was pressed. I don't care what state the switch is on the light switch, i just want it to toggle the relay whenever it is pressed.

    The OpenHAB rule looks like this:

    rule "Cinema Room Light Toggle" 
    when
    	Item CinemaRoom_Switch01 changed 
    then
    	if (CinemaRoom_Light01.state == ON){
    		sendCommand(CinemaRoom_Light01, OFF)
    	} else {
    		sendCommand(CinemaRoom_Light01, ON)
    	}
    end
    
    rule "Cinema Room Light State Sync"
    when
    	Item CinemaRoom_Light01 changed
    then
    	if (CinemaRoom_Light01.state == ON){
    		CinemaRoom_onboardSwitch01.postUpdate(1)
    	} else {
    		CinemaRoom_onboardSwitch01.postUpdate(0)
    	}
    end
    

    So to sum up, the relay board works fine with being toggled on or off from the webui or my custom made light switch node running the button sketch. It also works perfect with its own on board switch too. However, once you use the on board switch, it takes 2 presses on the custom made light switch node and the webui. This was happening before, so that is when i implemented this new rule, and its been working perfect for a couple of months, but all of a sudden it has stopped working, almost like the rule has been deleted.

    If you're not sure on what could be going wrong, explain how you would have these two nodes setup to be able to toggle the light.

    Thanks,
    Sam.


  • Hero Member

    @Samuel235 Do you need the remote switch to go through your controller?
    If you are not using the controller to add extra functionality you could just go directly from node to node. I have done this with this project
    It does not toggle the output but you could soon change that.


  • Hardware Contributor

    @Boots33 - while this would be a suitable work around, i was hoping i could keep the switch going to openhab rather than node to node. This will allow me to assign other things to the switch at the same time pretty easily (I suppose i could assign other things to happen when the light is activitated but ide rather the switch).

    I also was attempting to have the switch send on the same MQTT channel as the light listens, however it doesn't work when using the on board switch then, it knocks it all out of sync still.


  • Hero Member

    That's cool, just thought I would throw it into the pot. I don't use OpenHAB so can't be of much help there i'm afraid.



Suggested Topics

  • 1
  • 14
  • 20
  • 13
  • 8
  • 17
  • 107
  • 1

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts