Rule Machine Custom Action: Device only has Polling and Initialize capabilities

I'm using the user-contributed Yolink integration.

I'm trying to create a rule to refresh the MQTT listener connection when the Yolink motion sensor goes quiet. I've found that if it is quiet more than 4 hours, then somehow Yolink is no longer pushing info to the YoLink Cloud MQTT listener.

The rule I've created so far is shown below. The problem is that I want to run custom actions on the YoLink Cloud MQTT listener (Reset, Initialize and Connect), but I can't select that device, as it has none of the capabilities listed under Run Custom Action, so I can't select the YoLink Cloud MQTT listener to run one of its actions. Is there some way I can get rule machine to run those actions?

After doing some more reading, I decided to edit the driver and add "Actuator" capability, which allowed me to do what I wanted to.

However, in general, is there some way to run custom actions on a device that doesn't have a capability listed in the dropdown? Having to edit the device is not user-friendly.

No, the driver should implement at least one capability. If it sends commands, "Actuator" is the best choice; if it only reports readings, "Sensor." (Most will implement other "real" capabilities, so this only comes up in odd cases like this; these are sort of catch-alls in case nothing else is more appropriate--or really something you'd normally include in addition to these too.)

If this isn't your driver, this is a suggestion you may wish to consider providing to the author. The issue isn't specific to RM; most inputs in most apps on Hubitat select for devices based on capability. Without one, such apps will not allow you to choose the device (though this sounds like one you wouldn't use with most apps anyway, which is probably why it's never come up).

1 Like

Thanks. I'm tagging @SteveBarcus , the developer. Looks like "Sensor" would be the appropriate capability.

I'd probably go with "Actuator," in no small part due to the fact that you're sending a custom command to it and RM lets you select "Actuator" but not "Sensor" for this particular feature. :smiley:

1 Like

As a side note, after reviewing how the driver works, to restart it I'm only running the commands:
Reset and Poll.

The MQTT Driver is a passive listening device. It establishes a MQTT (listening) connection with the YoLink Cloud server. If the connection drops, then the driver automatically reconnects it. There should never be a need to interact with it.

If a device is not responding on Hubitat, then:

  • Look at the sensor's history on the YoLink mobile app and verify that the Cloud is receiving the updates from the device. If not, then the MQTT listener will not be notified.
  • Use the YoLink mobile app and insure that the sensor has the latest firmware.
  • If it's just one device not working, it might be defective.
  • Insure the battery is sufficient in the sensor and that it's in range.
1 Like

I did verify that cloud is receiving by looking at sensor history. I've also checked that the firmware is up-to-date. If YoLink mobile app is successfully receiving the data from the device but the Hubitat YoLink app is not, then the problem can't be the device. And when I find these gaps in the Hubitat app, the MQTT listener shows as "connected". So somehow the YoLink server stops sending events to the listener.

I made some improvements to the Listener. Use HPM Update to download the new driver.