Trigger rule with log text

Is there a way to trigger a rule if a log contains a certain string of text for a device? I can’t seem to find an answer on here and can’t figure out how to do it.

I’m not aware of a way to trigger a rule via a log entry - can you explain what you are trying to achieve? There may be other ways to do this…

I bet there is another way… I have Leviton DZ6HD dimmers. The preset level is set to 100 but this only works if you turn the switch on digitally. If you physically turn the switch on then it just turns on to whatever level it was last at. I found that if the switch is already on and I physically tap it on again… it generates unique text in the log but obviously the light is already on, so nothing happens. I thought if I could make a rule to do something whenever this unique text appears in the log I could essentially make it work like a double tap and make certain things happen with rule machine… although all I would really want it to do is set the dimmer to 100.

Does the driver report the tap of the top paddle somehow? With my Inovelli switches, it reports a button press. If the Leviton driver does the same, that could be used as the trigger.

I bet a driver could be made to support a double tap with these, but right now there’s nothing out there. I was just curious if the tap would be reported in the logs and sure enough it was. It looks like this:

I figured if I could just use the unique part of this text to trigger an action then I could make it work. Of course, I could make a rule such that whenever the light is turned on it goes to 100, but some lights are set to dim to certain levels depending on time of day… so I’d prefer to simply control it with an extra tap. These DZ6HD dimmers are so frustrating. They have so many problems. I regret buying so many of them.

1 Like

I wonder if this is something that could be part of a future update? The ability to use text in a log to trigger an action… I don’t know enough about programming to know whether or not that’s even feasible.

1 Like

It seems Rube Goldburg to me :smiley:

Logs are a Record of an Event. The Event contains the pieces that logs display.

Thus the trigger should be the Event, and an evaluation of the pieces of an event will drive the Action.

Example: This is a text representation of an Event:

{ "source":"DEVICE","name":"motion","displayName" : "MultiSensor6A (officeDesk)", "value" : "active", "type" : "null", "unit":"null","deviceId":845,"hubId":0,"installedAppId":0,"descriptionText" : "MultiSensor6A (officeDesk) motion is active by SensorBinaryReport"}

Note that "descriptionText" is usually what's found in the logs. Note also that it's made up of two pieces that are also elsewhere in the Event. You're asking to parse the contents of "descriptionText", but the words that change are going to be found in the other elements of the event.

Here's another Event:

{ "source":"DEVICE","name":"illuminance","displayName" : "MultiSensor6B (masterBath wc)", "value" : "12", "type" : "null", "unit":"lux","deviceId":761,"hubId":0,"installedAppId":0,"descriptionText" : "MultiSensor6B (masterBath wc) illuminance is 12 Lux"}

Related to this is how the Event is generated. The Driver receives a message from a Device.. the code then manipulates the data if needed and does a "sendEvent" which would look like this:

    String descriptionText = "${device.displayName} button ${button} was ${action}"
    sendEvent(name: action, value: "${button}", descriptionText: descriptionText, isStateChange: true)
2 Likes

I sort of understand what you’re saying but I’m not sure how to use that information to do what I want to do.

Use the event that generates the log as the trigger, as opposed to using the log generated by the event that generates the log as the trigger.

As @csteele says, that is Rube-Goldbergish.

Well that’s the part I understand. I hear what you’re saying. What I would like to do is this: when the dimmer switch is on, if the paddle is pressed on again… I would like the lights to go to 100%. As far as the device is concerned there is no event recorded because the device is already on… but… something shows up in the logs. So when the switch is already on and you physically press it on again it somehow generates a log entry, but does not create an event that I can see anywhere.

Let me supply an idea, a concept that might help you...

Often, people set dimmers via automation to 95% (for full bright, obviously something else for dimmed.) When humans turn on the light and want to adjust it from "last setting" they will hold the switch til it gets to full brightness... 100%

Thus you can tell if automation set it or a human did by the value. I have Pico buttons that I use to set light levels in bedrooms.. 4 buttons (plus a "favorite") means I can set "Off", "33%" aka dim, "66%" aka natural, and "96%" aka full. Thus I can tell if a human set touched the switch because no one can bee that accurate. :smiley: If they don't use the Pico, then I can tell.

4 Likes

Fair enough. I know it’s a weird idea. Maybe one day someone will be bored and update the driver to harness the power of an extra tap of the switch…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.