Jump to content

Yolink Local API


roho

Recommended Posts

Posted
On 7/1/2025 at 9:34 AM, sjenkins said:

with all the above and the ip you can fill in the config of the local yolink plugin

I understand that the UAID and SECRET_KEY in the node server configuration page will be the same as with the old hub.  How does one "fill in" the config page withe the local net ID and access token?

Posted
4 minutes ago, Panda88 said:

click on the localHub and get the needed info under general and integrations

 

 

No problem doing that.

I currently cannot get the curl to respond for the access key.  Did the given instructions work as written for you @Panda88 ?

Posted
On 7/3/2025 at 11:31 AM, sjenkins said:

No problem doing that.

I currently cannot get the curl to respond for the access key.  Did the given instructions work as written for you @Panda88 ?

I have a ticket in with YoLink now.  Just to understand in my communications with them has ANYONE besides @Panda88 been able to get the local-hub to give you the Access Key ?

 

Posted
        response = requests.post(self.local_URL+'/open/yolink/token',
                                 data={ "grant_type": "client_credentials",
                                        "client_id" :  self.local_client_id ,
                                        "client_secret":self.local_client_secret }, timeout= 5)
        if response.ok:
            temp = response.json()
            logging.debug('Local yoAccess Token : {}'.format(temp))
Posted
On 7/8/2025 at 1:47 PM, Panda88 said:
        response = requests.post(self.local_URL+'/open/yolink/token',
                                 data={ "grant_type": "client_credentials",
                                        "client_id" :  self.local_client_id ,
                                        "client_secret":self.local_client_secret }, timeout= 5)
        if response.ok:
            temp = response.json()
            logging.debug('Local yoAccess Token : {}'.format(temp))

Appreciated @Panda88, unfortunately still getting a timeout error.  Was good to validate your python version with mine versus the curl equivalent.  

Still waiting for tech service to get back to me.

So I can continue to pull my hair out can you verify the "obvious" for me.....

1. you are using port 1080 in your URL

2. the client secret starts in sec_v1_ and ends in == , those are included in the text sent

3. you don't use the button on the back for anything during this process, correct?

4. I have mine set-up with both ethernet and wifi and have tried both ; what do you use?

 

Thanks for any breadcrumbs....

Posted
1 hour ago, Panda88 said:

correct - I do not recall if I had to push anything on the hub - I only use ethernet

I found some info on home-assistant forum initially that helps me get going

So tech support got back to me this morning and told me they had pushed Firmware 0606 to my unit over night.

And **BOOM** everything works as advertised & I no longer feel like I am insane or an idiot !!

For those who have a box seeming like it is working in the app but will not talk to your curl or request to get the local access key, keep this in mind!

now maybe I can test this plugin out....

  • Like 2
Posted

I just had a few minutes tonight and thought I would finally try getting this connected.

After reading @sjenkins last post, I checked and sure enough there was an updated for the local hub. Updated that, filled out the config page for the plug-in, restarted and all is working!

Weird thing is I didn't have to curl, between the info from the local hub and the existing Yolink plugin. Then I got to thinking, in order for all devices to report to the local hub and not the original hub, that may be where I need to use the curl command. Don't know yet. Ran out of time tonight.

Thank you @Panda88 and @sjenkins for your persistence and forging the way!

-Tim

Posted

I so not think there is a need for curl. It is separate from the node.  You just need to move you devices to the local hub - do it one by one initially.  If you have more than 1 hub (for range reasons)!the local hub must be able to see the device you move 

  • Like 1
Posted
9 hours ago, TJF1960 said:

I just had a few minutes tonight and thought I would finally try getting this connected.

After reading @sjenkins last post, I checked and sure enough there was an updated for the local hub. Updated that, filled out the config page for the plug-in, restarted and all is working!

Weird thing is I didn't have to curl, between the info from the local hub and the existing Yolink plugin. Then I got to thinking, in order for all devices to report to the local hub and not the original hub, that may be where I need to use the curl command. Don't know yet. Ran out of time tonight.

Thank you @Panda88 and @sjenkins for your persistence and forging the way!

-Tim

@TJF1960 thank you for the kind words. Also, you are right the plugin does the heavy lifting and gets the access code for you. Like many here I am a bit of a geek and want to know how my new stuff works. The curl or python script is for those who want to talk direct to the device like plugin writers. But I am glad I did it because I would have been blaming @Panda88 when his plugin didn’t work!  If someone isn’t up to curl and is having issues I could share my script as a setup/hardware tester to see if comms is happening. 

  • Like 1
Posted
4 hours ago, Panda88 said:

I so not think there is a need for curl. It is separate from the node.  You just need to move you devices to the local hub - do it one by one initially.  If you have more than 1 hub (for range reasons)!the local hub must be able to see the device you move 

I added one temp/humidity sensor to the  local hub. Looks like that’s all you do is add it in those settings. Back in the app’s  device screen there was now a symbol in that devices’s square like an Ethernet symbol. When I checked the node on the plugin there is a field for type of connection but that was blank for this and all the nodes which were added. @Panda88 is this a future feature?

My next steps in testing was to:

1. simulate internet down and see what works.

2. Move more devices over

3. Move my programs over & disable the old ones. 
4. not with plugin but was going to play with the local automations. Might still use those for the leak sensor to house water valve. 
 

question, is there any value to the old hub now except that it has a speaker (understanding we are still in beta on this plugin, so post beta)?

are there any “duelling banjos” problems with two that you have seen?

Posted

Correct - I have not found a way to identify the connection type yet - I have a request in but no reply yet

The old hub can be used to extend range of network (but the devices attached will not be local (yet - they are working on this) - I have some devices in a pump house that the local hub does not reach reliably (I have an ethernet conenction there), so I hope they will get this working 

Posted

I have production Yolink running in slot 15. I added beta Yolink to slot 25. After configuring the plugin in pg3 with the identical client/secret keys as the production version, all devices populated in the beta plugin and were an exact match to the production plugin. Both plugins seemed to run fine. After a few minutes though, the production Yolink nodes started not responding to commands. But in Yolink's app they responded fine. I am assuming that there was some conflict with the new local hub and main hub causing the issue.

After I deleted beta Yolink and deleted the local hub from my app, the devices slowly started to respond to commands.

Question, is this how the rest of you are testing the beta, using the same client and secret keys as the production Yolink or are you testing with a new test setup?

Also, second question, I noticed that aside from the node slot, the device identifier in pg3 were identical between production and beta. For instance n_015_15432dfd413df1 in production while for beta the same node was identified as n_025_015_15432dfd413df1.

Do you think I can delete production from slot 15 and install beta in the same slot and I wouldn't have to rework all my programs?

-Tim

Posted

Tim

Maybe you can try to make 2 homes - that should allow 2 sets of credentials and allow operation of existing node - you need to move your test device to the new "home" - I think the new home needs the local hub for testing

I do not know enough about PG3 to answer the ID related issues

Posted

@Panda88Thank you. Let me ask this, do you envision merging these two plugins at some point, in the near future or do you think you will keep them separate? Also, last question, was the beta built on the latest updated production version of Yolink, or is it a rev or two behind?

I really appreciate the help, Thank you.

-Tim

Posted

The local is a few revisions behind - I did not update it when people could not get hub

I should be able to use the same code base for both, but initialization is a little tricky as I do not know if system is local or not when the node starts (so it would require to different programs/code to start the node) - beyond that it is common code - this is how it is now - but in two different branches currently (that is why it is behind) - I was planning to let the user specify if local is needed (through the config) but I have not gotten around to look at it yet (config is the most complex part due to the multi-threading of PG3) 

It may be possible to keep it as one - and it should be a goal, but not sure when I can make it 

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...