# Lightwaverf API

**URL:** <https://community.homey.app/t/lightwaverf-api/9586>\
**Category:** Apps\
**Created:** [February 23, 2019, 11:12am UTC](https://community.homey.app/t/lightwaverf-api/9586 "2019-02-23T11:12:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 8, 2019, 7:04pm UTC](https://community.homey.app/t/lightwaverf-api/9586/21 "2019-04-08T19:04:34Z")

</div>

@Adrian_Rockall

Adrian! This is fantastic! It works!!! I’m at work but I’ve successfully added devices! Thanks so much!  
All my devices other than the home and away button and the three gang dimmer are visible and added!

We should try to get Lightwave to send you some devices without you having to order them; you’re being generous enough as it is with your time…

FYI, these are the logs now the devices have been

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 8, 2019, 7:40pm UTC](https://community.homey.app/t/lightwaverf-api/9586/22 "2019-04-08T19:40:46Z")

</div>

@David_Thomas  
Excellent, so pleased its working.  
I will look into the three gang dimmer. I probably just need to add the relevant product code.

P.S. I’m not sure how sensitive those codes are so maybe you should edit your post add take out the logs. I think they are useless without the Bearer ID but better be safe.

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 8, 2019, 7:58pm UTC](https://community.homey.app/t/lightwaverf-api/9586/23 "2019-04-08T19:58:14Z")

</div>

@Adrian_Rockall

Thanks! I’ve edited out those codes. One question - when you run your app on your system, does it automatically update the status (power on/power off) of devices and the energy meter to trigger flows, etc?

It doesn’t on mine - Just trying to work out whether that’s something that I still need to get to work or if its just a case of this being a feature that hasn’t been coded yet and I need to be patient 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/aa531a541e6a7e7b607e7f4221e9d84dd856b8de.jpeg)

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 8, 2019, 8:06pm UTC](https://community.homey.app/t/lightwaverf-api/9586/24 "2019-04-08T20:06:41Z")

</div>

Interesting that the Home / Away has a product code and that’s the one I thought might be causing the problem. However, there is a device that’s not returning a product code so I think that might be your missing 3 gang dimmer. I’m not sure why the format is different for that. I did notice it had an “upgrade”: “yes” so maybe it needs to have the firmware updated.

> [@David\_Thomas](#):
>
> One question - when you run your app on your system, does it automatically update the status (power on/power off) of devices and the energy meter to trigger flows, etc?

It should request an update when first connecting and then gets updates via a webhook after that. I use a flow that picks up a dimmer being switched off and switches off a z-wave light. I must admit I don’t think I tested the flows using the energy meter so I will test that soon.

You could try restarting the app now you have devices add just in case my changes have broken the web hook initialisation at inclusion.

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 8, 2019, 11:23pm UTC](https://community.homey.app/t/lightwaverf-api/9586/25 "2019-04-08T23:23:06Z")

</div>

Good spot re the firmware upgrade! I’ve done this now, much to my wife’s dismay as the lights started flashing while she was cooking 😉

Still no luck with the three gang dimmer or updating status though; even after a restart of the app; I think I’m missing some of the functionality that you have in that if I switch on or off a dimmer, say via the Lightwave app, Homey doesn’t ‘see’ that that is has happened. Good to know that this is possible, though; hopefully an easy fix.

FYI the latest debug is as follows; nothing obvious to suggest webhooks isn’t working.

Starting LW appInitialising Bridge  
Waiting for Bridge #0  
Waiting for Bridge #1  
Waiting for Bridge #2  
Waiting for Bridge #3  
Waiting for Bridge #4  
Waiting for Bridge #5  
Waiting for Bridge #6  
Waiting for Bridge #7  
Waiting for Bridge #8  
Waiting for Bridge #9  
Waiting for Bridge #10  
Waiting for Bridge #11  
Old LW Webhooks Deleted  
Bridge Initialised  
Registering Homey WEBHook  
Bridge Ready #0  
Bridge Ready #1  
Bridge Ready #2  
Bridge Ready #3  
Bridge Ready #4  
Bridge Ready #5  
Bridge Ready #6  
Bridge Ready #7  
Bridge Ready #8  
Bridge Ready #9  
Bridge Ready #10  
Bridge Ready #11

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 9, 2019, 8:14am UTC](https://community.homey.app/t/lightwaverf-api/9586/26 "2019-04-09T08:14:01Z")

</div>

I can’t see why the webhook is not working so I will add some more diagnostics message to the next beta. I will also remove the (possibly) sensitive codes from the output.  
My dimmers feedback within a second or two so I can stand next to the dimmer, with the phone on the Homey devices page, press a button on the dimmer and the phone updates as I look back at it. It’s difficult to time it as Homey fades the tile in and out.

I wonder if the 3 gang dimmer is causing any other issues as I can’t see why it has incomplete information being sent back. Just out of interest, in the Lightwave App for each entry of the three gang dimmer, does it show the code in there, e.g. “L23”. The single gang should show “L21” so you can see where it should be.

Can you post the contents of the unsupported devices field and I will try to contact LW to see if they have any explanation (that field has no sensitive information by the way). They might say you have to contact them so you can give them account details to allow them to check your devices.

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 9, 2019, 12:50pm UTC](https://community.homey.app/t/lightwaverf-api/9586/27 "2019-04-09T12:50:15Z")

</div>

Thanks; yes Lightwave shows the code L23.

Unsupported devices code follows below.

[

{

“device”: {

“identify”: “Yes”,

“reset”: “Yes”,

“upgrade”: “Yes”,

“diagnostics”: “Yes”,

“periodOfBroadcast”: “Yes”,

“rgbColor”: “Yes”,

“switch”: “Yes”,

“dimLevel”: “Yes”,

“dimSetup”: “Yes”,

“protection”: “Yes”,

“power”: “Yes”,

“energy”: “Yes”

}

},

{

“device”: {

“switch”: “Yes”,

“dimLevel”: “Yes”,

“dimSetup”: “Yes”,

“protection”: “Yes”,

“power”: “Yes”,

“energy”: “Yes”

}

},

{

“device”: {

“switch”: “Yes”,

“dimLevel”: “Yes”,

“dimSetup”: “Yes”,

“protection”: “Yes”,

“power”: “Yes”,

“energy”: “Yes”

}

},

{

“device”: {

“productCode”: “L2”,

“device”: “LinkPlus”,

“desc”: “Central Hub”,

“type”: “lwrfTwoWay\_v2”,

“cat”: “Hub”,

“gen”: 2,

“currentTime”: “Yes”,

“buttonPress”: “Yes”,

“time”: “Yes”,

“date”: “Yes”,

“monthArray”: “Yes”,

“weekdayArray”: “Yes”,

“timeZone”: “Yes”,

“locationLongitude”: “Yes”,

“locationLatitude”: “Yes”,

“duskTime”: “Yes”,

“dawnTime”: “Yes”,

“rgbColor”: “Yes”,

“day”: “Yes”,

“month”: “Yes”,

“year”: “Yes”,

“weekday”: “Yes”

}

},

{

“device”: {

“productCode”: “LW929”,

“device”: “N/A”,

“desc”: “Home & Away Remote”,

“type”: “lwrfTwoWay\_v1”,

“cat”: “Sensors”,

“gen”: 1,

“buttonPress”: “Yes”,

“rssi”: “Yes”

}

},

{

“device”: {

“productCode”: “LW929”,

“device”: “N/A”,

“desc”: “Home & Away Remote”,

“type”: “lwrfTwoWay\_v1”,

“cat”: “Sensors”,

“gen”: 1,

“buttonPress”: “Yes”

}

}

]

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 9, 2019, 10:01pm UTC](https://community.homey.app/t/lightwaverf-api/9586/28 "2019-04-09T22:01:58Z")

</div>

And of course, please do let me know if I can help in any way…

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 11, 2019, 8:17am UTC](https://community.homey.app/t/lightwaverf-api/9586/29 "2019-04-11T08:17:15Z")

</div>

@Adrian_Rockall Were Lightwave any help? Happy to contact them if you like.

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 11, 2019, 9:31am UTC](https://community.homey.app/t/lightwaverf-api/9586/30 "2019-04-11T09:31:19Z")

</div>

> [@David\_Thomas](#):
>
> @Adrian_Rockall Were Lightwave any help? Happy to contact them if you like

I have not heard anything yet. It might be an idea if you contact them and ask them to check your devices in their database. Mention that your three gang dimmer does not appear to be returning all the information to the API call. You could even send them the snippet from the settings screen as you have posted it above. The critical bit that I need is the “productCode”.

Just out of interest, what names have you given the dimmers on that three gang unit?  
I’m just wondering if there is a character that is confusing the JSON parser.

I have added more diagnostic message to the log and in doing so I have noticed that I seem to get reports from a socket device ID that does not exist in my house. I am currently trying to track that down as the webhook should only send responses for each users own devices. The Athom server should filter messages based on the users unique Bearer ID. So it’s probably some obscure mistake I’ve made when the event (webhook) is registered with LW.

While I’m working on the new version I wounder if another Diagnostic Report will show anything. Could you restart the app, wait for about 2 to 3 minutes then create the report like you did last time?

I have received my Home / Away remote but I am struggling to decide what capability to give it. LW report the two buttons separately so it shows as two devices, one for Home and one for Away. I tried setting them as buttons in Homey but it turns out Homey treats that as sending a command and not receiving and LW don’t accept a command as it is read only. Also LW send an ON followed immediately by an OFF so any user interface is too slow to show the action. I can get them working to trigger flows as a generic alarm but that just looks wrong. So I think I shall have to delve deeper into a custom capability which is a bit more learning for me.

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 12, 2019, 7:06pm UTC](https://community.homey.app/t/lightwaverf-api/9586/31 "2019-04-12T19:06:22Z")

</div>

Thanks very much Adrian; I’ve now messaged them.

My device names are “Far lights”, “Middle lights”, and “Kitchen light”.

I’ll run the diagnostic shortly.

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 12, 2019, 7:57pm UTC](https://community.homey.app/t/lightwaverf-api/9586/32 "2019-04-12T19:57:47Z")

</div>

The new diagnostic code is 1eade107-7a39-4d7c-9004-9283627752a7

Thanks Adrian!

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 13, 2019, 12:34am UTC](https://community.homey.app/t/lightwaverf-api/9586/33 "2019-04-13T00:34:33Z")

</div>

I have request a new beta to be published with the following changes:

- Updated bridge methods for better queuing of transactions.
- Updated the settings page so the log is on a separate tab.
- Added an option to switch logging off.
- Log data panel is now refreshed when new data arrives.
- Changed WebHook function to filter on a different parameter.

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 13, 2019, 12:49am UTC](https://community.homey.app/t/lightwaverf-api/9586/34 "2019-04-13T00:49:52Z")

</div>

> [@David\_Thomas](#):
>
> My device names are “Far lights”, “Middle lights”, and “Kitchen light”.

Nothing strange there then so that rules out another theory.

> [@David\_Thomas](#):
>
> The new diagnostic code is 1eade107-7a39-4d7c-9004-9283627752a7

The diagnostics feedback shows an error is thrown which I think is in the Homey core. It appears to take issue with the WebHook data as it’s trying to convert it to an object ready to send to the App.  
Unfortunately I can’t see the raw data in the report so I have no idea what LW is sending that confuses Homey.  
I have reported the error to Athom to see if they can shed any light on the matter, or at least catch the error so it doesn’t kill the app.

The new beta might help as I have simplified the filter parameters in the WebHook. Also the extra logging might show something.

Hopefully LightWave can find a solution for your account. As far as I know you are the only one having problems which makes me think there is an issue at their end but I won’t give up as I don’t like being defeated 😀

I still haven’t added the Home / Away remote yet as I want to get the current stuff working for you first.

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 16, 2019, 8:24am UTC](https://community.homey.app/t/lightwaverf-api/9586/35 "2019-04-16T08:24:50Z")

</div>

> [@Adrian\_Rockall](#):
>
> The diagnostics feedback shows an error is thrown which I think is in the Homey core. It appears to take issue with the WebHook data as it’s trying to convert it to an object ready to send to the App

Athom have informed me that the error is thrown when the webhook is registered due to bad data. This data should come from the Bearer ID setting but the value being passed in is nothing like a valid bearer ID. Not sure why that should be though.

Anyway the new beta has just been published and this uses a different set of parameters to setup the webhook so it may solve the problem.

I have also re-written the way it queues message by going through a single instance of the bridge interface. This should prevent a race condition when the access token expires.

The settings page has been updated so the log is now in a separate tab with options to switch it on and off and if webhook message should be logged, plus there is a Clear button to easily erase the log. It also supports live refresh so it will display new entries as they appear.  
The app also logs more information to help diagnose problems should they occur.

@David_Thomas I recommend updating to this version to see if it helps with your webhook issue.  
Have you had any feedback from LW?

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 16, 2019, 4:35pm UTC](https://community.homey.app/t/lightwaverf-api/9586/36 "2019-04-16T16:35:28Z")

</div>

Brilliant thanks Adrian. Nothing yet from Lightwave unfortunately.

New log extracted below

Starting LW app

Searching for devices of type: dimmer

Found Location: 5bf33a0328b22a79b290b5eb-5bf33a0328b22a79b290b5ec

Found devices: undefined

Found devices: L2

Found devices: L21

Correct Device Type.

Logging Feature Set: 5bf33a0328b22a79b290b5eb-5bf33a2f28b22a79b290cc8a

Found devices: L42

Wrong device type

Found devices: L42

Wrong device type

Found devices: L42

Wrong device type

Found devices: LW929

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Connection Failed: Error: {“message”:“Request Error: Notification already exists”}

LW Webhook failed

Connection Failed: Error: {“message”:“Request Error: Notification already exists”}

LW Webhook failed

Connection Failed: Error: {“message”:“Request Error: Notification already exists”}

LW Webhook failed

Connection Failed: Error: {“message”:“Request Error: Notification already exists”}

LW Webhook failed

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 16, 2019, 5:09pm UTC](https://community.homey.app/t/lightwaverf-api/9586/37 "2019-04-16T17:09:16Z")

</div>

Can you switch all the logging options on and then restart the app? Then we should see the full startup procedure.

---

<div class="post-metadata">

**Author:** ![David\_Thomas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/david_thomas/32/8547_2.png) [@David\_Thomas](https://community.homey.app/u/David_Thomas)\
**Post date:** [April 16, 2019, 7:13pm UTC](https://community.homey.app/t/lightwaverf-api/9586/38 "2019-04-16T19:13:26Z")

</div>

Certainly

Starting LW app

--------- App InitBridge --------

Initialising Bridge

Deleting LW WebHooks

Waiting for Bridge #0

Waiting for Bridge #1

Waiting for Bridge #2

Waiting for Bridge #3

Waiting for Bridge #4

Waiting for Bridge #5

Waiting for Bridge #6

Waiting for Bridge #7

Waiting for Bridge #8

Waiting for Bridge #9

Waiting for Bridge #10

Waiting for Bridge #11

LW WEBHooks Deleted

Bridge Initialised

Waiting for Bridge #12

Location: \_5bf33a0328b22a79b290b5eb-

Registering Homey WEBHook

WebHook data: {

“id”: “\_5bf33a0328b22a79b290b5eb-”

}

Bridge Ready #6

Bridge Ready #7

Bridge Ready #8

Bridge Ready #9

Bridge Ready #10

Bridge Ready #11

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Bridge Ready #12

Bridge Ready #0

Bridge Ready #1

Bridge Ready #2

Bridge Ready #3

Bridge Ready #4

Bridge Ready #5

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registering LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

Registered LW Webhook

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 16, 2019, 8:51pm UTC](https://community.homey.app/t/lightwaverf-api/9586/39 "2019-04-16T20:51:04Z")

</div>

That all looks OK.  
If you enable the “Log Webhook Messages” do you get “Webhook found Device” messages appearing?

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [April 21, 2019, 8:32am UTC](https://community.homey.app/t/lightwaverf-api/9586/40 "2019-04-21T08:32:29Z")

</div>

@David_Thomas just wondering how it’s going?  
Did you get a response from LW?  
Are your devices now getting updates?

[Previous page](https://community.homey.app/t/lightwaverf-api/9586.md?page=1)

[Next page](https://community.homey.app/t/lightwaverf-api/9586.md?page=3)
