[RELEASE - BETA] - "YoLink™ Device Service" app and drivers to connect Hubitat™ to YoLink™ devices

Thanks Steve, I will try it out if/when I get the Yolink stuff.
Adam

I have a YoLink X3 Bulldog starter kit and Sensor 2 3-pack on the way that I was planning to use in their D2D mode for direct triggering in the event of a power/internet outage. While disappointing, I would prefer these work as a stand alone system then be cloud dependent in a true emergency.

However, in my video review binging over the weekend I came across this mention in one recent review from a month ago. At 9:30 into the review he mentions that he has his Yolink Sensors connected to the Valve Controller in a Direct Connection but gets an alert generated on the state change of the sensor / and or valve. I know in this review he is working in HomeAssisant, but wonder if the Habitat drivers might have access to the same state info for the Yolink devices when they are paired in a D2D configuration.

Video in question is here: https://youtu.be/A2LEAA18kqA?t=565

Like I said, I purchased this assuming it would be a standalone install, but if there is anyway to also have even minor integration into Hubitat for status alerts that would be a welcome bonus.

-mals

I've verified that the Hubitat does work in concert with the YoLink Automations.

I linked a Leak Sensor with a Manipulator (Valve) to have the Valve close if water is detected:

I created a Hubitat dashboard with the two linked devices:
Dashboard when Dry:

Dashboard when Wet:

The valve did close without any intervention required by the Hubitat.

Hi @SteveBarcus and @malsbury,
If this was done with the YoLink devices directly linked via D2D, then this is great news. When I first set up my system about two years ago, this was not possible (either YoLink devices had to be put into D2D and could not be manipulated with Hubitat rules, or they could be linked without D2D and they could then be manipulated through Hubitat RM rules). If this has changed so that both D2D and Hubitat Rules can be used simultaneously to manipulate my valve controller (meaning my information from two years ago is now incorrect, for which I am extremely sorry), this is GREAT NEWS! For what its worth, I could not get my YoLink devices to show up in the Hubitat YoLink Device Service App when they were paired in D2D when I set my system up originally.

In your example, if I’m reading it correctly, you are able to get valve and sensor states into Hubitat even when your valve is linked directly to your sensors via D2D (i.e., not going through the YoLink cloud).

A couple of questions:

  1. Are you still able to set up a rule in Hubitat to actually manipulate (open/close) your valve through a separate rule in Hubitat in addition to just reading states? This is what I was not able to do when I first set up my YoLink devices two years ago.
  2. Are the YoLink automations completely local in the YoLink Hub, or are they also cloud based and require a YoLink Hub cloud connection to work? If the automations are completely local as well, this is a great thing!
    TIA for any help on this.

I've done some experimentation using D2D to pair a Valve with a Water Sensor and controlling/monitoring them via Hubitat.

Important: The valve will go to the position that it was in at the time the D2D pairing was performed. Since you most likely want the water to turn off, start with the valve in the closed position. Note that the valve will NOT go to the opposite position once water is no longer detected. You'll have to change it manually.

Pairing for D2D usage only (no control from YoLink mobile app or Hubitat and neither Hub needs to be power on):

  1. Put the valve in the position you want it to be in when water is detected using the manual override on the valve. This will most likely be the "closed" position. (the position is crucial before pairing).
  2. Press the "Set" button on the water sensor for 5-10 seconds until the light starts flashing green.
  3. Press the "Set" button on the valve for 5-10 seconds until the light starts flashing green.
  4. Both lights will go out once they are paired.
  5. Place the valve back in the normal position using the manual override on the valve.
  6. Trigger the leak sensor (I just use my tongue :sweat_smile:) and the valve should move to the position it was in when paired.
  7. Place the valve back in the normal position using the manual override on the valve.

Using the devices with the YoLink mobile app and Hubitat
The YoLink Hub must be powered on and connected to the internet. Simply add the devices using the YoLink mobile app like any other YoLink device (scan the device's QR code). Make sure the devices are working correctly by using the mobile app to monitor/control them, then you can add them to Hubitat using the YoLink Device Service app. Make sure you have the necessary YoLink Device drivers installed. If not, use the HPM Modify function to download the additional drivers before adding the devices to the Service.

You can now use both the YoLink app and Hubitat to monitor and control the devices. Obviously, both Hubs need to be powered on and connected to the Internet to control/monitor them outside the D2D connection. Supposedly, YoLink is developing a local control Hub, but I have no further information on that.

This Hubitat rule worked fine for me:

2 Likes

Hi @SteveBarcus,
Just to clarify, if you have the valve and sensors D2D paired, do you need to set up a rule in the YoLink app, or does it already know that a triggered water sensor means to close the paired valve? Isn't making a rule to close the valve in Hubitat redundant, since that's already done in YoLink? When they are D2D paired, can you still set up a notification for which specific leak detector was the trigger? Thanks.

1 Like

Hi @SteveBarcus ,
Thank you so much for your detailed explanation for how to set up simultaneous D2D direct valve control/status along with control by Hubitat (when both YoLink Hub and Hubitat have internet access).

I would also like to second the request for answers to the questions posted by @adam_L, in particular, the one about whether a notification for which specific leak detector was the trigger (I currently have that in my Hubitat Dashboard as well as in my Pushover notification but was not sure if this can be done once the valve closure is directly linked via D2D since any or all the leak sensors can trigger the valve closure when linked via D2D.

Thank you again for all your efforts to sort this out!

Correct, there is nothing else required either in the YoLink app or in Hubitat to make the sensor close the valve when paired D2D. The Hubitat rule I showed was just to illustrate that rules work. The sensor in that rule was not paired D2D with the valve, so I wrote a rule just to show that the devices can be controlled though Hubitat without being D2D paired.

The issue in my use case is that if the sensor and valve is paired via D2D, can it still also be controlled via Hubitat? That is the problem I ran into when I first tried doing this about two years ago.

My rationale for attempting to see if D2D would work concurrently with Hubitat automations was that if the internet went down and I had a water leak, at least the D2D would close the valve. However, if this occurred with my internet working, then I would also get more information (i.e., specific location of the leak etc.).

Since I was not able to get these to work concurrently (it was one or the other), instead of using YoLink automations (which I understood needed cloud access), I ended up just putting my automations in Hubitat (since cloud access was needed to access the YoLink API anyway and Hubitat allowed for much more sophisticated automations).

I may have misread your previous posts (or at least misinterpreted them) as it seems from your detailed explanation for setting up D2D, that this limitation is still the case?

  1. Are you still able to set up a rule in Hubitat to actually manipulate (open/close) your valve through a separate rule in Hubitat in addition to just reading states? This is what I was not able to do when I first set up my YoLink devices two years ago.

I just paired 2 water sensors D2D with the valve. Pairing the devices D2D didn't affect my dashboard or notifications. I was able to monitor and manipulate the valve through the dashboard. All my YoLink automations and Hubitat rules worked as well.

  1. Are the YoLink automations completely local in the YoLink Hub, or are they also cloud based and require a YoLink Hub cloud connection to work? If the automations are completely local as well, this is a great thing!

It appears that they either reside in the cloud or perhaps they're on the Hub but they send the commands to the cloud to be executed. When I disconnected the YoLink Hub from the network the YoLink automations didn't work.

I also have a SpeakerHub so this is a neat little test Hubitat rule that announces where the leak is:

1 Like

Thank you so much @SteveBarcus for all your help with this.

So to be clear, if you were to unplug your internet access to the cloud, although your automations would not work through the dashboard (as the YoLink hub automations and Hubitat hub/YoLink automations need cloud access), your valve would still close without any internet if any one of the two water sensors you paired D2D was triggered? And if you had internet service, that all the Hubitat automations would work, despite the sensors being linked to the valve via D2D? That would be my ideal scenario (I was not able to get this to work previously but will try again).

I too heard directly from YoLink that they were considering a local hub but they had been hinting at this for quite some time now and I have not been able to get any updated information on this (fingers crossed, lol).

That is correct.
You don't even need the YoLink Hub to be powered on for D2D devices to work together.
So, if you have a power outage and then a water leak - no problem if the sensors are D2D :wink:

I did not get the Speaker Hub when it came out as I was using multiple Alexa Echo Dots (yes another potential point of failure) to make announcements around the house to announce the specific location of any leaks and I did not want to have to buy several Speaker Hubs at the time to put in each room (not to mention the WAF of having several “pods” in each room, lol). Also, my rationale was that to use the Speaker Hub as a TTS device required it to still be connected to the internet as it was not a local device (although I understand that the Speaker Hub can also be connected via D2D as well to make announcements, or was it a speaker siren?). I use a similar rule as yours to make an announcement on all the Echos to help locate the specific sensor that was triggered, as well as sending an emergency notification to my phone and iPad devices.

Again, thanks for all your work on this. I will try to pair via D2D and see if all my Hubitat automations and dashboards still work concurrently.

1 Like

@SteveBarcus ,

First of all, I just want to give you props for the fantastic job in working out how to get YoLink devices accessible through Hubitat via your app!

One question/request (if this is even possible without having to resort to CSS): I am using your app (among other YoLink device uses) to show my YoLink leak sensors status on my Hubitat “Leak Sensor” Dashboard. Using the “Water” attribute template in the Hubitat Dashboard, the “Wet/Dry” state, as well as the battery level and the temperature at each leak sensor is displayed. The wet/dry state is pretty obvious (it shows up as “wet” or “dry” on the tile). The battery level and temperature only shows on the tile as numerical values. While this information is very useful, would it be possible to append a “F” or “C” label to the temperature (depending on the temperature scale selected of course) and a “batt” or “charge” label to the battery level to satisfy the OCD in me, lol? I suspect that this may be a consequence of how these values are displayed in the device driver as only numerical values and not as text (perhaps due to the nature of the values in the API)?

Also, another attribute value that may be helpful to display in the “water” template is the rssi level (perhaps with the “dBm” label appended to indicate the signal strength). I see that this is an attribute that is accessible on the device page and also appears as an attribute in the YoLink App UI.

For those that wish to simplify or limit the information displayed in their water sensor tile, I wonder if there is a way to select only those attributes you wish display perhaps via a selection menu in the preferences section of the device page. I imagine this could be done via making such selections available on the device page via the device driver? Again, not being a coder, I do not even know if any of this is reasonable or even possible to do but it might be useful for and desired by some (at least by me anyways, lol)?

Anyway, your app is great as is (just some suggestions to make it even better) and thanks for all you do. It is much appreciated!

I'll take a look as to what is possible. Thanks.

Thank you all for the info and guidance since I first posted my question.

Since then I have received my YoLink kit and have it all set up and working now. For the record here is how I have it set up.

I installed the Bulldog Valve Controller on my water main and paired the 7 water sensors directly to it in a D2D configuration. This was my main reason for getting the YoLink kit so it is completely independent of the grid and cloud to respond to a leak during a worse case scenario of a power outage and internet outage.

I then set up the Yolink hub and an account with the Yolink App. Once that was setup I bound each of the YoLink devices to the app . I did not set up any automations or alerts in the YoLink app.

Next I installed @SteveBarcus' YoLink Device Service following his detailed guide to add the sensors and valve to Hubitat. The current status of wet/dry and open/closed are visible in the device info which is what I was looking for. From there I used the built-in "Notifications" app to alert on state of change for the devices.

Leak Sensors:

Valve Position:

I've tested this by wetting a sensor and the valve immediately closes and I get a push notification to my phone telling me that the valve has closed and then a separate notification telling me which sensor is wet. I also did an additional test to prove to myself that they were still using the D2D link despite being bound to the hub by unplugging the YoLink hub, waiting until the hub showed "offline" in the YoLink app, and then wetting a sensor and watching the valve close.

The setup and integration was easier than expected considering I didn't know it was even a possibility when I ordered the YoLink kit.

-mals

Thanks for the update. Glad it all worked out for you.

Hi @SteveBarcus,
I've set up the YoLink hub with two X3 Temp/Humidity sensors, and installed your app. The two sensors, as well as the hub and MQTT Listener, show up in my device list. The event logs show that T & H data is being retrieved, and I can display the data on my dashboard. However, in the logs, I get error messages at each read interval (example below):

dev:222023-04-06 12:50:00.317 PM error Message received: {"event":"THSensor.DataRecord","time":1680810600791,"msgid":"1680810600790","data":{"records":[{"temperature":21.3,"humidity":42.9,"time":"2023-04-06T19:40:01.000Z"}]},"deviceId":"d88b4c0100057a2e"}
dev:222023-04-06 12:50:00.316 PM error Unknown event received: DataRecord

Thanks, Adam

Thanks. That appears to be a new type of message from the API. I'll update the driver. It shouldn't affect the devices' usability by much though.

OK, thanks.