LightwaveRF - New LightwaveRF Binding

I didnt leave it last night as I was off to bed, but I suspect that’s when it dies most days. I’ve put a pause in between each TRV command to see if it stops it for now, but when I get a chance, I’ll get it to fire commands at a few at the same time and see if I can reproduce it

I’ve just changed a couple of bits in the code to see if it helps. Just about to test it then will put up.

  • Have added the full stack trace output from the websocket to see if we can narrow down the message
  • Changed rssi formatting
  • Changed the cost channel implementations as this is where @pentiumdb seem to fall over.

I assume this will be the version with the new device ids? I’ll have to pull my finger out and move over. Is it just the things I need to change?

oh… your errors on old version… :grimacing:
Sorry thought you had already.
Its a simple switch tbh, just change sdId to deviceid and the bit before the first hyphen and the bit after is the same for every device so you only need to look up 1 of them under properties (only exception is like @pentiumdb where he has 2 hubs) i.e:

Bridge lightwaverf:lightwaverfaccount:benfleet "Lightwave Account" @ "Cupboard" 
[ username="*****", password="*****",electricityCost=15,retries=5,delay=50] {

h21 	LightwaveHub			"Link Plus" 						@ "Cupboard"			[ deviceid="5c7d64783c570522afb151b5-1-3157331848+1" ]

s22 	KitchenSocket1			"Kitchen Socket 1" 					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-16-3157331848+1" ]
s22 	KitchenSocket2			"Kitchen Socket 2" 					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-17-3157331848+1" ]
s22 	KitchenSocket3			"Kitchen Socket 3" 					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-18-3157331848+1" ]
s22 	KitchenSocket4			"Kitchen Socket 4" 					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-19-3157331848+1" ]
s22 	KitchenSocket5			"Kitchen Socket 5"					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-20-3157331848+1" ]
s22		KitchenSocket6			"Kitchen Socket 6"					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-32-3157331848+1" ]
s22		KitchenSocket7			"Kitchen Socket 7"					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-31-3157331848+1" ]
s22		KitchenSocket8			"Kitchen Socket 8"					@ "Kitchen"				[ deviceid="5c7d64783c570522afb151b5-33-3157331848+1" ]

s22		CupboardSocket1			"Cupboard Socket 1"					@ "Cupboard"			[ deviceid="5c7d64783c570522afb151b5-34-3157331848+1" ]
s22		CupboardSocket2			"Cupboard Socket 2"					@ "Cupboard"			[ deviceid="5c7d64783c570522afb151b5-36-3157331848+1" ]

s22 	LoungeSocket1			"Lounge Socket 1" 					@ "Lounge"				[ deviceid="5c7d64783c570522afb151b5-21-3157331848+1" ]
s22 	LoungeSocket2			"Lounge Socket 2" 					@ "Lounge"				[ deviceid="5c7d64783c570522afb151b5-22-3157331848+1" ]
s22 	LoungeSocket3			"Lounge Socket 3" 					@ "Lounge"				[ deviceid="5c7d64783c570522afb151b5-24-3157331848+1" ]
s22 	LoungeSocket4			"Lounge Socket 4" 					@ "Lounge"				[ deviceid="5c7d64783c570522afb151b5-25-3157331848+1" ]
s22 	LoungeSocket5			"Lounge Socket 5" 					@ "Lounge"				[ deviceid="5c7d64783c570522afb151b5-27-3157331848+1" ]

s22 	MasterBedroomSocket1	"Master Bedroom Socket 1"			@ "Master Bedroom"		[ deviceid="5c7d64783c570522afb151b5-30-3157331848+1" ]
s22 	MasterBedroomSocket2	"Master Bedroom Socket 2"			@ "Master Bedroom"		[ deviceid="5c7d64783c570522afb151b5-7-3157331848+1" ]
s22 	MasterBedroomSocket3	"Master Bedroom Socket 3"			@ "Master Bedroom"		[ deviceid="5c7d64783c570522afb151b5-6-3157331848+1" ]

s22 	GeorgesSocket1 			"George's Bedroom Socket 1"			@ "George's Bedroom"	[ deviceid="5c7d64783c570522afb151b5-11-3157331848+1" ]
	
}

I keep meaning to, then I run out of time, will make the jump when you put the next version up

2.5: https://github.com/delid4ve/LightwaveRF-Jars/blob/main/org.openhab.binding.lightwaverf-2.5.13-SNAPSHOT_3.7.jar

will put 3.x up shortly @pentiumdb

1 Like

So just found an issue…
The websocket only receives updates for a certain amount of time. I wasn’t getting status updates after a while, then i opened the app and they started coming in again. Sonoff also behaves like this so looking at a fix right now.

Having issues, I’ve added the new version, changed the device ids, I re-enabled my office light switch first and that seemed to work fine, but adding others I’m getting things like below

10:42:38.291 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'lw_TopLanding_switch' received command ON
10:42:38.297 [INFO ] [arthome.event.ItemStatePredictedEvent] - lw_TopLanding_switch predicted to become OFF

I switch the light, but nothing seems to happen

Give me 2, just compiling a fix

Ignore me, user error!

There is an error though… notifications will show no listener present (picked up from @pentiumdb logs).

That’s what I get when I don’t have an item defined for a feature

Yes but was also doing it for unsolicited notifications when there is a channel linked :+1:

2.5.x: LightwaveRF-Jars/org.openhab.binding.lightwaverf-2.5.13-SNAPSHOT_3.8.jar at main · delid4ve/LightwaveRF-Jars · GitHub

I’ve taken out the ping on the websocket for now as I think this may be what was causing it. See if we can workout how long it takes for the notifications to stop. I might need to wireshark the app to see what its sending to receive the message you get when you open the app as this seems to kick it back to life

Fix broken cost channels where I changed the implementation:
2.5.x: LightwaveRF-Jars/org.openhab.binding.lightwaverf-2.5.13-SNAPSHOT_3.8r1.jar at main · delid4ve/LightwaveRF-Jars · GitHub

loaded and doing some testing.

I’ve been looking at the TRVs some more, and it looks like they just take a long time to respond sometimes (between 1 and 3 seconds sometimes). So if it retries 5 times, you eventually get all 5 responses. Rather than retrying maybe you could look at being able to specify a longer wait time for response?

Also, while typing, one of them happened to contradict me and all 5 tries failed

11:31:25.426 [TRACE] [ternal.LightwaverfSmartCommandManager] - Message received: {"version":1,"senderId":1,"direction":"response","items":[{"success":false,"error":{"source":"server","group":18,"code":101,"message":"hookManager: Disconnected - the destination disconnected before a reply was received (1)"},"itemId":"131"}],"class":"feature","operation":"write","transactionId":3309438}
11:31:25.433 [DEBUG] [ternal.LightwaverfSmartCommandManager] - Websocket response was an error with code 101 and message hookManager: Disconnected - the destination disconnected before a reply was received (1)
11:31:25.438 [TRACE] [ternal.LightwaverfSmartCommandManager] - Message received: {"version":1,"senderId":1,"direction":"response","items":[{"success":false,"error":{"source":"server","group":18,"code":101,"message":"hookManager: Disconnected - the destination disconnected before a reply was received (1)"},"itemId":"131"}],"class":"feature","operation":"write","transactionId":3309439}
11:31:25.444 [DEBUG] [ternal.LightwaverfSmartCommandManager] - Websocket response was an error with code 101 and message hookManager: Disconnected - the destination disconnected before a reply was received (1)
11:31:25.449 [TRACE] [ternal.LightwaverfSmartCommandManager] - Message received: {"version":1,"senderId":1,"direction":"response","items":[{"success":false,"error":{"source":"server","group":18,"code":101,"message":"hookManager: Disconnected - the destination disconnected before a reply was received (1)"},"itemId":"131"}],"class":"feature","operation":"write","transactionId":3309441}
11:31:25.454 [DEBUG] [ternal.LightwaverfSmartCommandManager] - Websocket response was an error with code 101 and message hookManager: Disconnected - the destination disconnected before a reply was received (1)
11:31:25.460 [TRACE] [ternal.LightwaverfSmartCommandManager] - Message received: {"version":1,"senderId":1,"direction":"response","items":[{"success":false,"error":{"source":"server","group":18,"code":101,"message":"hookManager: Disconnected - the destination disconnected before a reply was received (1)"},"itemId":"131"}],"class":"feature","operation":"write","transactionId":3309447}
11:31:25.464 [DEBUG] [ternal.LightwaverfSmartCommandManager] - Websocket response was an error with code 101 and message hookManager: Disconnected - the destination disconnected before a reply was received (1)
11:31:25.467 [TRACE] [ternal.LightwaverfSmartCommandManager] - Message received: {"version":1,"senderId":1,"direction":"response","items":[{"success":false,"error":{"source":"server","group":18,"code":101,"message":"hookManager: Disconnected - the destination disconnected before a reply was received (1)"},"itemId":"131"}],"class":"feature","operation":"write","transactionId":3309450}
11:31:25.471 [DEBUG] [ternal.LightwaverfSmartCommandManager] - Websocket response was an error with code 101 and message hookManager: Disconnected - the destination disconnected before a reply was received (1)

I can add a delay time to the account config to wait for the response to come back, its currently 1 second before it tries again.

that’s a new message I’ve not seen before, ill have a think…

Give me 10/15 ill post a new version. @pentiumdb let me thrash these problems out with @xela and then ill compile 3.x

I’ve found the web socket issue (got a full stack error and it didn’t recover), got to pop out for a bit but will have updated version a bit later

1 Like

Managed to get some changes made, have changed some timeouts, see how it fairs
2.5.x LightwaveRF-Jars/org.openhab.binding.lightwaverf-2.5.13-SNAPSHOT_3.9.jar at main · delid4ve/LightwaveRF-Jars · GitHub

Is it a parameter I need to change, it still complained after 1 sec

14:02:22.155 [DEBUG] [connections.LightwaverfSmartWebsocket] - Sending message: {"version":1,"class":"feature","operation":"write","direction":"request","senderId":"4b701507-f6d8-46ff-8f74-5894eafbbb5f","items":[{"itemId":"127","payload":{"featureId":"5df8b6728522075debd21ad8-138-3157346060+1","value":150}}],"transactionId":127}
14:02:22.161 [DEBUG] [connections.LightwaverfSmartWebsocket] - LightwaveRF - Websocket message sending completed: {"version":1,"class":"feature","operation":"write","direction":"request","senderId":"4b701507-f6d8-46ff-8f74-5894eafbbb5f","items":[{"itemId":"127","payload":{"featureId":"5df8b6728522075debd21ad8-138-3157346060+1","value":150}}],"transactionId":127}
14:02:23.170 [ERROR] [ternal.LightwaverfSmartCommandManager] - Ok message not received for transaction: 127, command was null : 150 for Device: null, retrying again. Retry count 2