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

@SteveBarcus just to make you aware. I'm using some Yolink sensors in node red and get the following error message but the contact and motion sensors that I'm using are unaffected by the way I use them and I'm not using the temperature for anything. Just wanted you to be aware. Thanks for the Yolink integration.

image

1 Like

OK! Yesterday I installed the API driver and the drivers for the THSensor and Door Switch that I have (plus all the other device drivers just for good measure) and was able do to successfully replace my kludged-up YoLink IFTTT bridge code and some proxy virtual devices with direct Hubitat connections through the API to the actual YoLink devices themselves, yay! My previously obtained UAID and secret key worked just fine without my having to renew them with YoLink.

Currently I have the polling interval set by the YoLink API app to 1 minute so that I could easily test changing inputs to the sensors without waiting around too long. (Is it safe to re-run the YoLink API app anytime I need to change the polling interval? I was concerned that running it again might create duplicate devices.)

The Door Sensor (which I use in our mailbox to indicate mail arrival) worked great right off the bat. In fact the mailman arrived just as I had finished installing it and I got the notification exactly as I expected.

The THSensor I have had a few issues with. To begin with, after the initial installation I was not getting automatic polling to track changes in temperature. If I manually clicked the Poll button on the THSensor driver's page then it would update immediately; if not there were no live updates.

When I looked at the THSensor device log with (with Debug logging disabled in the YoLink API Device settings) I could see that the THSensor driver was throwing Groovy errors anywhere there was the assignment of devstate = object.data.state.state, ie on lines 276 and 342:

(There is also a similar assignment at line 199 but that assignment either does not fail or is never executed.)

When I replaced those lines at 276 and 342 with the assignments devstate = "normal" and devstate = "alarm", respectively, the runtime system stopped throwing errors. And when the errors stopped, the timed THSensor polling then began working correctly.

Very curiously, the devstate assignments did not fail when Debug logging was enabled in the YoLink API Device settings. But of course then my log was filling up with a huge amount of benign debug status data. I could not see anywhere in the driver code that Debug logging could possibly be affecting actual driver execution semantics.

So anyway, that's my bug report, and for the time being I will operate with my 2 one-line patches in place to get normal operation in non-Debug mode. Let us know when you are ready to entertain suggestions for feature upgrades, etc.

Thanks for the feedback. I'll return the temperature values as a string in the next release of the Service App.

You can run the service app as often as you wish. It checks to see if devices already exist and will not create duplicates. I will look into the errors. Thanks for the feedback.

1 Like

If you look at the State Variables for one of the failing temp sensors, what version of the driver is it using? Thanks.

image

Ok, I fixed the parsing errors.
The device will report on temperature changes without the need to poll it - it's the parsing error that's preventing that. It'll work correctly with the fix.

I created a new thread for Suggestions and feature requests:

1 Like

Updates now available in HPM:

2 Likes

@SteveBarcus I try to update the Yolink app etc and also try to modify but it is not showing up? I will try later and see if it shows up.

Using the " View Apps and Drivers" selection in HPM, these are the current versions of the app and drivers that should be shown (only shows the drivers you've installed):

@SteveBarcus I still getting the errors from node red?

image

also here is my apps version. If there anything you would like me to do, let me know. Thanks

Are you using Celsius or Fahrenheit in the app settings?

I'm using Fahrenheit.

New versions of app and drivers released (use HPM Update to get them):

image

1 Like

I am trying to register and am getting a failure logging in.

Authorization token refresh failed :Auth Failed

Insure that the UAID and Secret Key specified in the YoLink Device Service match those from the YoLink app on your mobile device:

  • Make sure there are no leading or trailing blanks in the inputted values.
  • Make sure that any characters that look like other characters were not typed incorrectly, e.g., make sure an "O" was not typed in as "0" (zero) or a "1" one typed in as a "l" (ell), or vice-versa.
  • Make sure the case is correct, e.g. , "O" vs "o".

I copied and pasted them.

It is working now.

Ok, thanks.

The following devices are now supported (Use HPM to install updated app and drivers):

  • In-wall Switch (YS5705-UC)
  • In-wall Outlet (YS6704-UC)

Current App and Driver Versions:
image