Parking sensor green/red light


I have an inferred beam that reports activity when something breaks the beam. It is hooked up to a Ecolink contact sensor external inputs and works like a charm on notifications. It is fast and solidly reliable.

I was building a rule to help with parking in the garage, and I’m having trouble. I get it to turn off and on but I want it to go from green to red when the beam is broken and a vehicle is blocking the beam and then back to green when the vehicle has cleared the beam. It should only come on when the garage is open which is the test contact sensor.

*Note (The beam contact states report open/closed are reversed, which I am aware of.)

Green light on when garage open (test contact)
Turn red when beam closed vehicle passing by
Turn green when beam open. No vehicle passing by
Turn off when garage (test contact) closed

**Edit to the correct category.

Try this.

1 Like

I think adding IR Shop beam as a trigger should make it work. I'd also delete the first Set color action as I don't think it is needed.

Trigger Event
Testing Contact contact open
IR Shop beam contact *changed*

Actions to Run
IF (Testing Contact contact open) THEN
    IF (IR Shop beam contact closed) THEN
        Set color: Parking Lamp Red...
        Set color: Parking Lamp Green...
    Wait for Expression: Testing Contact contact closed
    Off: Parking Lamp

I have plenty of space and I typically back up too far. I thought this would be good to have an indicator light up quick once the vehicle was clear of the threshold. I like your suggestion and need to think about it a bit more. If the garage door is open it also would be nice to not have it on when I’m walking in and out of the garage. The over thought can definitely make it complex.

Let me test the suggested above and will report back.

Alright, the first part of this worked, but the return to green when the beam is cleared does not turn the light back to green.

@deserthillsdrive It should work the same. Turn on logging, try again and post the results and your current rule.

Here is what I have set up.

If I understand correctly how you want it to work, the garage door open condition should be in a required condition, not a trigger.

Required condition: garage door is open

Trigger: beam sensor changes


if beam is blocked, set light red


Set light green

End if

I would create a second rule to turn the light on and off based on the garage door being open or closed.

So if the door is closed, changes to the beam sensor do nothing. When the door opens, the light turns on. Changes to the beam sensor trigger the rule and turn the light red or green. When the door closes, the other rule turns the light off.

I implemented @neonturbo’s solution and at first was using Rule Machine to manage the indicator light but ran into issues sometimes where multiple execution of rules were stepping on each other especially as I was walking in and out of the garage unloading the back of my car. I ended up creating a custom app to manage instead and it’s worked great.

My app turns on and off the indicator light and beam sensor based on the state of the garage door being open or closed. The indicator light will remain on for X minutes, defined in the app, and not stay on indefinitely if garage is left open. Though once the beam is broken it immediately turns back on. Happy to share if interested.

Hi, interesting approach. Initially this was installed to alert me if anyone walks into the shop if I’m out back or inside the house for a few minutes. It has a pushover set up that gives me an alert and day and time. It WAS tied to a chime but that got old very fast with activity in and out of the garage from visitors chatting at the garage threshold.

I like the idea of turning it off and on as well and am interested in understanding more. When you say app, was it added as a user app?

Thank you

That doesn’t seem so complicated which is good. Let me see what I can do with this when I get home to have a foundation and grow from there. I will report back.

Help me understand what's not working here.

15:15:56 Testing Contact open, IR Shop beam closed so Parking Lamp Green
15:16:03 IR Shop beam closed, Parking Lamp Red
15:16:04 IR Shop beam open, Parking Lamp Green
15:16:42 Testing Contact open, Parking Lamp off

Per the logic and 4 trigger events, the rule functioned as it should have. What were you expecting to happen different?

Edit: The door was opened for 46 minutes and perhaps you cycled the IR Shop beam more than twice. If that's the case, check the Events on the device page and see how many are shown between 15:15:56 and 15:16:42.

This is a custom written app in Groovy that you load into your hub.

You can see pictures of my setup here. I am using a Zooz Zen17 to control my garage door as well as the contact sensor for the beam sensor. When the garage door opens, I turn on the beam sensor and when it is closed, it turns it off. In the Zen17 setup I am using "motion" instead of contact because I have yet another automation that manages my overhead lights and will turn them on if motion is detected when the LUX of my outdoor sensor is below a certain threshold - no point in turning on the lights if it is light in there.

The return to green from red does not actually work on the bulb. The original green to red works, but not once the beam clears.

@deserthillsdrive If you look at the logs there appears to be a "green from red" event at 15:16:04. Per the logs, the Green action occurred at 15:16:04.504. Are you saying that the bulb didn't respond? Is there a corresponding event in the Parking Lamp event logs?


You’re not wrong, but the light is not changing every time. I finally was able to have it turn green when open, red when blocked, and green again, but there was a delay or it wouldn’t work at all.

Then I tried again and it wouldn’t go back green.

Logs for the rule:

Logs for lamp: it looks like something is wrong here. I’m using a Sengled color changing bulb. When I get his to work, I’m changing it to an RGB led strip/diffuser.

And the current state rule:

I'm concerned that your Infrared Shop bean contact events aren't being seen consistently by the hub, possibly because of a mesh issues. Is this a Zigbee or Z-wave device? Do you have any repeaters between this device and your hub?

Here is my suggestion to check this device. Open the IR Shop beam device page on your phone. This is a dynamic page and will show the current state of the device. You''ll see it change real-time between open and closed. Hit the configure button and give it a minute or two to configure your device. Open the garage door and exercise the device. Report back if you're seeing the device page update the contact state correctly as you block and unblock the beam.

Once you're confident the IR Shop beam contact is reporting reliably you can do the same with the Parking Lamp.

1 Like

The beam is also hooked up to a notification through Pushover and has been alerting every time it is blocked. This has been installed for two years. It is a zwave Ecolink contact sensor using the external input two wire connection.

Last night I changed the wire configuration thinking I could reverse the open/close status for easier understanding, but it did not change the contact status. When the beam is reflecting on the reflector, it is reporting open. When it is blocked, it reports closed. I did update the rule to “closed”. That’s when it seemed to work intermittent.

Also, when I block the beam for a short moment the system notifies me and sometimes the light changes. When I block the beam for a longer period of time, the light seems to be more consistent, which I find odd because without failure it always notifies.

It sounds as though you're confident the IR Shop beam contact is working reliably based upon the Pushover notifications. I would then move to the Parking Lamp. Can you command it from the device page and how quickly does it respond?

If that works well then I'd try to create a test rule that mimics the original rule but simplified to the IR Shop beam and Parking Lamp only.

When I use the command page and the sharptools dashboard it is Instant. I’m not sure the delay in the rule but will simplify and circle back.

Download the Hubitat app