Lightwaverf API

Lightwaverf have just announced the API for their generation 2 Link Plus.
It’s possible to obtain an access key via the latest Lightwaverf App.
If there’s any devs out there that would like a new challenge I for one would appreciate it.
I will have a go myself but as it will be my first it might never work :grin:

1 Like

But I think they were referring to the generation 1 products which had an app in homey v1. That communicated directly using the 433MHz transmitter. The new Lightwaverf products are on 868 Mhz and use encryption.
Hopefully I am wrong and now the API is published they will take it on.
I will put in a support request to see if they will be bold and give me an official answer.

1 Like

I’m making progress with an app. I can now pair dimmers and switch lights on and off and dim them.
Just struggling with the webhooks at the moment as Lightwaverf just returns an error message when I try to register the events. Support request entered so hopefully they will get back to me.

1 Like

Athom’s app is in beta, don’t know if it’s V1 or V2:
https://apps.athom.com/app/com.lightwaverf.homey

1 Like

According to Bram it’s an update on the existing broken one that’s supports generation 1 (connect series) devices…
I put in a support request before starting my project to see if Athom were planning to support gen 2 devices and Bram said not in the near future so go for it.

1 Like

Adrian_Rockall,

Thanks very much for taking the trouble to make this app. I actually bought a homey a couple of days ago but almost immediately put in a return request after I saw how few official, supported apps there were, with no official app for Lightwave Gen 2. I bought it with the understanding that I could use it to integrate my automation kit, but it seemed like a bit of a patchwork solution.

However I am starting to think that perhaps I should give it more of a chance, since I discovered your app. Unfortunately I can’t get it to work though - I’ve put in the codes but it doesn’t seem to do anything…image

@Adrian_Rockall

Thanks very much for taking the trouble to make this app. I actually bought a homey a couple of days ago but almost immediately put in a return request after I saw how few official, supported apps there were, with no official app for Lightwave Gen 2. I bought it with the understanding that I could use it to integrate my automation kit, but it seemed like a bit of a patchwork solution.

However I am starting to think that perhaps I should give it more of a chance, since I discovered your app. Unfortunately I can’t get it to work though - I’ve put in the codes but it doesn’t seem to do anything…

Hopefully I can get you up and running.
After you put the codes in and hit the Save Changes button did you then go through the add devices procedure?
What LW devices do you have?
Did you make sure the Refresh Token on the LW app / web page is up to date by hitting the Refresh Token button?

Can you provide any more information about what you are doing and what doesn’t work?

1 Like

@Adrian_Rockall Thanks very much!

I did indeed - although I’m not sure the Save Changes button did anything… I didn’t see a confirmation or anything like that.
I have three gen 2 sockets, a single gang gen 2 dimmer, a triple gang gen 2 dimmer and a gen 2 home/away button. I also have some gen 1 kit that I haven’t wired up yet.

I have refreshed the Refresh Token a few times and re-inputted it into your app, and tried reinstalling your app, but no success.

And for the long read:

  • I have a homey 2019 running 2.0.

  • Homey is connected to a ‘guest’ wifi network. The lightwave gen 2 hub is connected via an ethernet cable. They won’t see each other on the LAN, but Homey and lightwave both have internet access via a firewalled connection that doesn’t do port forwarding.

  • When trying to get the app to work, I input the bearer token, refresh token, hit save changes, then try to add the devices I own. However, it can never find any new devices.

@David_Thomas Sorry your having problems but please bare with me as this is the first failure report I have had so I have no history of problems to call upon.

The app should find the gen 2 sockets and dimmers but won’t yet find the home/away button (but we can try to add support for that later).

I have also noticed that the save button gives no feedback and is something I will look into. Currently the best way to confirm it has worked is to leave the settings page and come back to make sure the settings are still there. Also, try saving the settings, then restart my LW app and check the settings are still there. (The refresh token might be different to the one you enter so see the next paragraphs)

I presume you have no other third party apps connecting to the LW API? One restriction I think the LW API has is only one interface can connect as the refresh and access tokens are one time use. So once a new refresh token is generated, the old one is no longer valid and each time an interface uses the refresh token to get an access token it also gets a new refresh token to use when the access token expires.
My app updates the refresh token in the settings page each time it is renewed so one check you could make is to see if that changes after searching for devices to add.

I wonder if Athom have added anything in later updates that allows my app to work. I keep my Homey up to date by installing experimental versions so I am currently using 2.1.1- rc.1. Maybe you could make sure that Homey is running the latest release version to see if that helps.

I don’t think being on separate networks should be a problem as the Homey app gets it’s information directly from the LW server. So provided both have internet access then that should be OK.
I do keep all my devices on the same network so that other things can talk to each other directly. My guest network is just for visitors so they have internet access but can’t access any of my devices. I’m not saying you should do the same but just pointing out a difference between our configurations.

After going through the add devices procedure, do you see anything in the settings page, below the refresh token field?
That should list all discovered devices that are not recognized by the app.

Are you able to run my app via the Homey CLI?
Don’t worry if you have not ventured into this area, it’s just that the app displays many diagnostics message when it runs that way.

Finally for now, could you try hitting the “Create Diagnostics Report” button in the page where you would see “Restart app” and “Uninstall”. I’m not sure what that will give me but fingers crossed that Athom provide some useful information :grinning:

I have request a new beta be added to the store. Athom can take anywhere between an hour to a week to approve this so keep checking.

The new features are:

  • Rewritten some sections so the connections and webhooks are renewed after changing settings. This means you no longer have to restart the app after making changes.

  • Added a confirmation message when saving settings.

  • Added a diagnostics log to settings page to help trouble shoot connection issues.

So @David_Thomas can you update to this when it is available and then check the new diagnostics log to see if it shows any errors.

@Adrian_Rockall - Thanks very much for taking the time to work through this with me; I really appreciate it!

I’ll update to the new app when it shows as available. Until then, responses below:

  • The app does remember my tokens, so yes I believe the save button is working.

  • I also have amazon Alexa connected to lightwave, but this is via the Lightwave RF ‘skill’ rather than via the API codes.

  • I tried searching for devices, but the refresh code in your app remains the same.

  • My Homey is running 2.1.0 (i.e. the latest release version).

  • I have put all my IoT devices on my guest network as I’m conscious that some IoT devices don’t have great security, so wanted to isolate them from my computers, etc. - wouldn’t want to be hacked via my kettle! Lightwave is an exception as it connects via an ethernet cable, but if needed, I can connect it to the guest network too by connecting it to a wifi extender.

  • After the above, I just see “” in the settings page below the refresh token field.

  • I’m afraid I don’t know how to use the CLI…

  • Currently my diagnostics code is D56DB4B73B. I’ll send you a revised one after I install the new app :slight_smile:

@David_Thomas OK, so the as the refresh token is not changing it would suggest the initial connect to the LW server is not happening. Can you check if you have any firewall that might be blocking communications from Homey in some way.

Alexa is not a problem as I also have that connected to mine.

When you search for new devices do you get any message or just “No new devices found”?

Also, just to be sure, you have installed and selected my “Lightwave Smart Series” app and not the Athom “Lightwave RF” app?
So you see the following screens snips:

image
image


image

And touching Install goes through the searching step OK?

Your Homey version should be fine as my app was published before that was released.

I haven’t received a diagnostics report yet so maybe that doesn’t work for some reason. I presume you did it through my app rather than the Homey settings?

@Adrian_Rockall Thanks; I do have a few firewalls running, but Homey has connected to the internet, as has Lightwave . Is there a particular server and port I should whitelist?

Confirmed - I’m using your app.

Sorry, I think I used the wrong button to generate the diagnostic. I’ve tried again and have the following code: decba43f-39fe-413f-8299-3ee4eae05bd0

@David_Thomas
OK I now have the report through. I think I can see what’s causing the problem, but not necessarily what’s causing the problem :grin:
The search aborts because a piece of information is not present in the received data so it throws an exception when an attempt is made to access it.
I can see what I need to do to solve the exception and continue the search for devices so hopefully that will allow you to find supported devices.
I’m not sure why the information is missing but maybe it is the home/ away button.

I will fix the problem and submit the update so fingers crossed I have read the log properly.

Thank you for your patience and help.

Requested 1.0.7 to be published as beta.
This should fix an issue that aborts the search for devices if a device that has no product code is present.

I have ordered a Home / Away button this morning so I can try to add support for it. Hopefully I will also see if that is causing the issue @David_Thomas is having.

@David_Thomas - The beta app has been published.
Could you try it to see if it allows you to add the supported devices?