How can I tell that a simple automation rule fired?

I setup a Simple Automation Rule that turns off a smart outlet at 2:30am on thursdays and another rule that turns it on at 2:31am on thursdays.

Is there a way that I can see that it fired? It controls my cable modem that needs a periodic reboot to stay healthy.

I have enable logging turned on and I have enable app events turned on (not sure what app events are) and I am not seeing anything in any logs.

Easiest place to start might be at the target device, in this instance the smart outlet. What does event logs look like there?

I assume you mean: (sorry fairly new to hubitat)
Go to devices
click on smart outlet device (called router)
click on "Events" button in the upper left corner

That event log only shows one event from Nov 3rd where the event says Name: switch and Value: on.

There have been two thursday mornings since then.

If the transition isn't showing up here I assume I have messed up the automation rule and it isn't firing?

That's kind of weird. I clicked on the gear icon for the simple automation task and I see the Scheduled Job table says that it is scheduled to next run tomorrow at 2:30am and that the previous run was today at 2:30 am even though I have it set to only run on thursdays.

I also don't have not set mode or between two times.

Try enabling logging within the simple rule itself and at the device level... so yes go to devices, choose your device, and then enable logging (or debug logging if you really want to get fancy). If you enable debug logging I would disable it once you've verified the rule is working.

Another way would be to go into the cable modem console itself and see when the last time it was rebooted.

And yet third way... send a notification to a device. I often use an Amazon echo for notifying me when I am messing with new rules. Of course at 230am that might be mess convenient.

Just a comment... a cable modem that needs a weekly reboot is indicative of a problem either with the cable modem itself, or something else on the ISP's network. Really shouldn't have to do that.

PS: To check the logs go to "logs" on the left menu and then click "show past logs"

The rule will be scheduled to be evaluated at 2:30 daily but will only run on a Thursday as your restriction will stop it running on any day apart from Thursday.

1 Like

Thanks @brad5.
I have all those logs enabled already (have been since I created the rule). The logs appear to be empty so I am figuring that I have something messed up with the rule itself.

I think the next step is to set the mode and check every mode.

And yes, I agree that a cable modem that needs rebooting frequently is not an ideal situation, but my ISP really doesn't splurge for the good stuff. :slight_smile:

Could be that the message isn't getting to the device, but my first hypothesis is usually that the message didn't get sent. Just as an aside, what turns the device back on, and does the status on the device say on or off at the moment - rule generally won't run if the status is already in the desired state.

@thebearmay
I have two simple automation rules, one set for 2:30am to turn it off and another (defined the same way) to turn it back on at 2:31am.
Currently the state is on.

Gotcha. I just saw the screen shots you posted. The rule looks really simple and you shouldn't have to mess with modes since the default would be to ignore them altogether. I have noticed occasionally that if I use my browser's "back" button while editing a rule it can have unpredictable consequences. Perhaps because the rule is so simple you should just delete it and recreate it?

I would also enable logging on the end device - sounds like this is a smart plug. That way you should see in the logs where the rule kicks off (probably every night) and then on Thursday you should also see the plug go off and on again.

It might be a good idea to toggle the switch off and on again from the "device" menu on the HE to verify the device is responsive, though depending on how your home network is wired that could be a pain :slight_smile:

PS: I know this is a stupid question but... I am assuming the smart outlet in question is zigbee or zwave, not wifi?

@brad5 Ok, I will delete it and recreate it. I have been trying to find a time when the rest of the house will let me toggle the device manually. It seems we are about to all have lunch so night might be a good time.

The smart outlet is an ikea smart outlet (zigbee). I have another one that I haven't automated but that i know I can toggle using HE's console.

I am also going to move the hub closer to the device before thursday's event. Maybe the hub is too far away. I had to move the hub to pair with a zwave switch, but it's final home will be less than a foot from the outlet.

If the issue were your zigbee mesh wouldn't the rule itself show up as having fired but the device would just not cycle,. At first glance I bet that isn't the issue. Are those your only two zigbee devices?

How about this... take the zigbee outlet connected to your router out of line with your router and plug it into a desk lamp or other device closer to your hub. Get the rule working just fine using a different time, one where you will notice the light coming on and off. Once you've confirmed it working (and that it shows up in the logs!) change the time and plug the outlet back into the router.

Or... if you remove the smart plug from the router and just plug it into a spare outlet near the router you can test it to your heart's content. If you turn it on or off and the status as shown on the device page doesn't change (especially after a refresh) you've got an issue.

You can try this link (replace IP address with the address of your HE) to get at least some sense of what your zigbee mesh looks like...

http://192.168.1.11/hub/zigbee/getChildAndRouteInfo

How to read this table is the subject of much discussion... but if your zigbee outlet shows up in the neighbor table check it's link quality (LQI). I usually see mine in the 250+ range and when I see one down in the 100s that can sometimes be an indication that the connection to the end device is not that great.

1 Like

Could also define a virtual outlet and use it instead...

1 Like

Yeah true good thought! Except that wouldn't tell you if the outlet itself was working...

True, but would allow testing of the rule

Yeah def a good idea... especially since he can't unplug his router randomly during the day :slight_smile:

Well, I tried triggering it manually and it did trigger but the status on the HE device page didn't update. Then I moved the hub down to be next to the router and outlet. I turned it off manually and back on manually. I noticed that the status on the device page didn't update even though I could see that it changed state. I did a refresh and it got the new state.

The strange thing is that now when I look in the log for the device I only see one event ( a switch off event), even though there were at least 2 switch offs and 2 switch ons. Something is screwy for that device on the HE page.

I will try with a second outlet I have to see how it behaves and get the rule working with that outlet.

I seem to recall it can take a zigbee mesh a while (like hours or days) to rebuild... though unplugging the HE and moving it will definitely cause a rebuild to start! What showed up in the logs?

When I pressed the "off" button on the device page for the second device, it initially didn't seem to put anything in the log. I then enabled debug logging and tried to power cycle the device. Both events then showed up in the log. I turned off debug logging and tried another power cycle and both events showed up again. So at this point it seems to be logging fine.

I wonder if I need to cycle the debug logging on the router outlet to get it logging. My family is about to leave the house so I will get to experiment with that outlet.

I haven't touched the rule and wont have a time to do it for a couple days.

Thanks for everybody's help. At least I know I wasn't missing something silly.

Weird logging behavior. I'm forever turning logging on and off and have not noticed that before. I don't know enough about the inner workings of logging to know. For instance, does the zigbee device get told to send advanced debugging info, or does it always send the same issue and the HE decides how much to discard or log? Beyond my technical knowledge.