Simple 1 button, on or off

I am so confused here, its simple, I have a Zwave plug (switch) I want a switch that i have in another room, to simply turn the light on , if its off, or off if it;s on.

Simple If then statement, but no clue how to click my way into getting this to work.

Do you already have a "Button Controller" device in the 'other room'? If so, and it is paired to Hubitat, you can easily use Hubitat's Simple Lighting App to toggle a Switch via a Button.

1 Like

I do, and it works for what I explained, but I would like to know how to do this, for other things.. this was just an example.

Rule machine is quite hard..

Here is the same example in Rule Machine

1 Like

Your title mentions a button but your description mentions a plug (switch) and a switch in another room. Do you have a button or a switch? That would make a difference on how you can write this rule in RM.

i have a button, that controls a zwave plug.. thats the simple part..

If you want to use RM this is a pretty simple way to do it. You could make the ELSE statement an ELSE-IF statement and check to see if the outlet is OFF.

You could also just toggle the outlet.

You could also use the Button Controller app that is part of RM as ogiewon suggested.


I agree that rule machine takes some playing with to become used to, however it is very powerful and you don't have to worry about syntax or spelling errors.

One of the concepts that helped me get started is understanding the relationship of Triggers and (Conditions + Actions)

As simple as it sounds, the trigger event(s) will determine if the Rule will run.

So in the below the rule will run when

  • When time is 10:30 AM EST
  • When the time is 10:30 PM EST
  • Varialbe becomes EndPartyMode (xxxx) = true

Note: here the xxxx is the current state of EndPartyMode. You don't have to enter it.

If any of the listed triggers occur then the Actions will be evaluated.

The rest is IF THEN ELSE etc.

I would recommend two things:

  1. For any rule, think it out and write it down before attempting to create the rule. For me I often realize I forgot something or left out a condition when I have to write it down.

  2. Start small. Create some simple (maybe even useless) rule. Like turn a light on at 8:00 PM. Then start adding additional actions as you get the hang of it.

1 Like

What you are saying doesn't make sense. Do you mean the button on your Z-wave plug? If so, that is not a button in the HE sense of the word. That button is not exposed to HE the same way that a button controller is. That button merely toggles the outlet that it is built into. You won't get button events from that device the same way that you will from a regular button device.

Can someone explain why my button rule doesnt work?

I have a button that I want to change the mode to turn on all lights to 100%, and change the mode to a static mode called effectiveness. To return lights to normal, I want to just press the button again.

To make things clearer for myself, I made the rule speak what it does and somehow it only speaks "Mode set to effectiveness" and the mode never changes back..

Well, the first thing I noticed is that your rule doesn't possess an "END-IF" at the end of it. Also, I don't think that actions with a delay work the way you think they do. When you put a delay on an action, it is scheduled at the beginning of the rule's execusion. If you want to put a delay between actions, you need to use an Action of Delay from the actions drop-down menu. The way you have your actions set up, as soon as the IF is evaluated, if will speak the message, then set the mode. Then 1 second later it will do actions 4 and 5, then 2 seconds later it will do action 2. If that is not what you intended, then you should remove those delays and insert actions of delay between the actions.

not sure how else to explain it.

I have a remote switch, I want to make sure the light in the bedroom witch is a Zwave plug, is on,or off, and if either one, I want the oppite to happen,... I know all the devices, I am just asking how to get the operation to happen.

What is the model of your "remote switch"? You haven't given any specifics of anything. If this is truly a switch, then it is not a button controller and talking about button devices will do you no good. Can you please tell us the exact devices you are using?

Inovelli Z-Wave Switch, the secondary button and a GE Z-Wave Wireless Smart Lighting Control Lamp Module.. I don't think it's really relevant , but that is what I got. as I know the devices in the Hubitat that need to be controlled and polled for being on/off.

I am just trying to help you, there is no need to be rude. As I said, an inovelli z-wave switch is not a button controller. There is no way to give an accurate recommendation to do something unless we have an accurate picture of the devices involved. Any advice that you are given about button actions would have been incorrect if you are talking about a switch.

That only applies to Z-wave non-plus devices and really has nothing to do with this conversation. This only applies to capturing local, physical changes on the device. Not changes made from the hub. So, any changes to your GE Lamp module that are made from the hub will be captured whether you poll it or not.

I suggest that you are little more tolerant of people asking follow-up questions in an effort to help you. Those questions might not seem relevant to you but the person asking them might know something you don't. So, the information could be very relevant to resolving your problem. I recommend that you contact for further assistance. Good luck.

I apologize if you thought I was rude, it was not my intention

.. either way, i am trying to replicate what the simple lighting app does, it works with no issue, if I tell it I push a button, it turns the light on, if it's off and the other way around, I would like to know how to do the same operation in the Rule machine, as it would give me a better understanding on how to get it to work for more complex tasks.

I understand that the simple light toggles, so it knows when the light is on or off. so how do you do that exact same thing in the rule machine.

@JNS I think that is what I am looking for. The programing language seems to be what I am looking for.

now.. here's the question i am really stuck with, how do you click your way though to get that IF - Else - END IF.

They should be listed under Conditional Actions.

Conditional Actions -> IF (conditions) THEN

Then later when you want the ELSE-IF, Conditional Actions -> ELSE-IF (conditions) THEN. Etc.

Ok.. one last question, I think i got it.

How do you move a condition up one? it seems you almost need to work backwards, as you can add conditions BEFORE, but not AFTER.

like I I wanted to add the END-IF, it seemed like I needed to make the Turn something off after
I made the end-if.
there is no "Insert Action After" or at the end.

Not sure what to tell you... I do them in order when I do them. I only insert if I change it AFTER I make the action, and decide it needs to do something else.

I also almost never "pre-make" my conditions, though. That may be the different. I just specify "new condition" and make the condition as I'm doing the logic.