Lightwave Generation 2 component

Any luck getting it setup?

Yes, its working a treat! Although to be honest, I tried so many different things, I’m not sure what specifically caused it to work, sorry.
It’s taking me a while to get my head around the way Hass.IO likes to do things, but I’m getting there. I have an Aeotec Multisensor running through a Z Stick; detecting motion and activating the Lightwave relay.
I’m just stuck on trying to understand Bit Masks, etc, whilst enabling threshold reporting on the multisensor!

Yeah got it working as well. Works really well.

Would love to see this become the new official component.

1 Like

Worth pointing out that the lightwave gen 2 api just got release https://lightwaverf.com/blogs/news/smart-series-api

Might be worth integrating into this component since it already works well.

Thank you so much for all your contributions in getting this working. I am new to HA and have been steadily learning and growing my system over the past 2/3 weeks. I have loaded your custom components and it works.

With the new HA update 0.88 it now has a new structure for the custom components where it wants to be [/lightwave2/light.py] [/lightwave2/switch.py] and so on. I have tried moving the files around into the folder and file structure that they outline but I can’t make it work. Any chance you could help me out by explaining what I need to do or release an update that I can pull from here?

Sorry for the cross-post, but just seen that Lightwave announced API information for their Smart Series (Gen 2) devices. Exciting times!

Hi - have just pushed a new version that fixes the structure. Works for me, but as always, let me know if any problems.

Bah! I knew it wouldn’t be long after I released this that they’d finally release the official API!

I’ll have a look and see whether I can face rewriting everything for local control!

Hmmm. Had a quick look at the API. Still seems to be cloud based. Sending commands to the linkplus seems relatively straightforward, but receiving events looks to be a bit awkward and not necessarily easy to hook up to HA. I’ll play around more this weekend.

1 Like

Thank you so much. I managed to cobble it together very late last night myself but had no faith I did it right.

So glad that you spun the update out so swiftly, looking forward to seeing what more you can do now with the public api. Thanks again.

Has anyone managed to get Lightwave G2 working with HA now they have released their API?

I can connect and send commands using the official API, but the API for receiving events appears to be broken. I’ve emailled Lightwave but no response.

BTW I’ve just pushed a new version, should be slightly more responsive.

Not sure if anyone else is getting this but I had the latest custom component you just posted installed on 0.88.1 with no errors. Just now upgraded to 0.89 and it is spitting out the below about the climate component

Error loading custom_components.lightwave2.climate. Make sure all dependencies are installed

Traceback (most recent call last): File "/usr/src/app/homeassistant/loader.py", line 166, in _load_file module = importlib.import_module(path) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/config/custom_components/lightwave2/climate.py", line 2, in <module> from homeassistant.components.climate import ( ImportError: cannot import name 'STATE_AUTO' from 'homeassistant.components.climate' (/usr/src/app/homeassistant/components/climate/__init__.py)

Thankfully I don’t have any climate stuff so doesn’t really affect me. All I get is that notification on startup.

Thanks john - fixed!

No problem that was rapid. Have updated to your latest version and the error has gone away. Just the normal warnings that say you are using a custom component. Or as I read it custom component loaded successfully.

Thanks again for all the effort you have no idea how much it’s appreciated.

Hey @bigbadblunt, First of all I want to say a massive thanks for creating this component, it’s been a real life saver! I’m just experiencing a few issues that I myself don’t have the technical knowledge to fix, so I was hoping for your insight…
or context I’m fairly new to HA but have been playing with lightwaverf gen 2 for a couple of months and am gradually getting through the process of swapping every light switch in the house. So this could be a problem I’m facing due to my own inexperience or a misconfiguration on my part, but I think I’ve found a bug with the component.

The issue first I’m experiencing relates to dimming, essentially I can turn my lights on and off fine, but if I set a light to some random brightness like 42% in HA/HA Homekit integration it’ll dim down to that brightness, but if I turn the light on and off it’ll drop by 1 or 2% each time I switch it on and off. so if I set a light to 11% and turn it on and off 10 times it’ll end up at one percent. This issues doesn’t present all of the time but it does happen most of the time. The only solution I can think of is setting an automation to run each night that sets all my lights to 100% then turns them off, but this seems like a bit of a faff and wouldn’t be best suitable for lights in the bedroom etc.

The other issue I’m facing is where a light will be physically on but will say it’s off in HA. initially I thought my link could be losing signal with the switch or something but upon checking the lightwave app the status is right in the native app but not in HA. Essentially the light is physically on, on in the lightwave app, but says it’s off in HA.

If you or anyone else on here has any ideas on this, or would like more info, please do get in touch!

Thanks again!
Nicki

Hi Nicki - the brightness bug is now fixed. I’ve just pushed a new version to github.

The second problem is more difficult as I can’t reproduce. If you can capture some logging output then I can see if I can work out the problem. Put the following lines in your configuration.yaml

logger:
  default: warning
  logs:
    lightwave2.lightwave2: debug

Also, when does the problem occur - is it if you use the physical switch, or the lightwave app to control the light?

Hey, Thanks so much for working on this so quickly!
Loaded the new component and the dimming issues have resolved, so no more funky automations needed for me! cheers

I’ve added the code above to my config so hopefully I’ll be able to capture something useful that you can take a look at. It’s a difficult one really as it seems to happen at random with just one or two lights out of the blue. I’ll leave it logging for a week or so and then get back to you with something. Where are the logs stored? I have SAMBA enabled…

The problem seems to only occur when using the physical switch, but then again I never really use the lightwave app, except for trying to investigate issues like this, so I’m not sure I’d notice it.
Basically I can switch a switch on at the wall and 9 times out of 10 it appears as on in HA, but every now and again I’ll switch the hallway or conservatory light on with the switch and the light will come on but will appear as off in HA. Yet oddly, when I go to the lightwave app to check if the hub knows it’s turned on it says on in the LWRF app but is still off in HA. It’s as-though the lightwave app isn’t telling HA a switch is on, even though it obviously knows about it… if that makes sense?

Honestly can’t thank you enough for all your help in this,
Nicki

I too have had the same issue that Nicki has been reporting regarding the action on a physical switch is not captured on HA but is on lightwaverf app. Much like Nicki I too have been setting up HA for about 2 months so have been monitoring and ironing out a lot of things. I am now at a point where my system is very stable and works.

So wasn’t wanting to report this to you until I knew it wasn’t just my setup being borked.

From what I have seen the issue occurs after HA has been running for a long period of time without restarts for say +12 or more hours but does vary depending on active use of the system at home.

If I press a physical light switch it does not register on HA. If I then use HA to toggle a switch it will work but there is a delay. As if it is re-establishing it’s connection to Lightwave again.

After a HA toggle action the physical button toggles are picked up by HA again for a long period of time.

I will add the log lines of code to my configuration and see what that captures to help you out.

Again thanks so much for your development in this component. You rock, without it HA would be pretty useless for me.

I managed to catch it with the debug log script on just now.

I came home today anticipating it could happen as I know that’s when this normally occurs as I am at work and nothing has been used for that whole time.

Switched on the kitchen light and watched HA, it did not update. Checked LWRF app and it correctly had the Kitchen light status as on.

This is what was in the log.

2019-04-09 18:58:53 DEBUG (MainThread) [lightwave2.lightwave2] Received WSMessage(type=<WSMsgType.TEXT: 1>, data='{"version":1,"senderId":1,"operation":"event","class":"feature","direction":"notification","transactionId":52301738,"source":"rfProtocol","items":[{"payload":{"featureId":"5c3b515e5e33aa33645653cc-83-3157330816+1","value":1,"status":"ok"},"itemId":1}]}', extra='') 2019-04-09 18:58:53 WARNING (MainThread) [lightwave2.lightwave2] Message with no _feature: {'version': 1, 'senderId': 1, 'operation': 'event', 'class': 'feature', 'direction': 'notification', 'transactionId': 52301738, 'source': 'rfProtocol', 'items': [{'payload': {'featureId': '5c3b515e5e33aa33645653cc-83-3157330816+1', 'value': 1, 'status': 'ok'}, 'itemId': 1}]} 2019-04-09 18:58:53 DEBUG (MainThread) [lightwave2.lightwave2] Received WSMessage(type=<WSMsgType.TEXT: 1>, data='{"version":1,"senderId":1,"operation":"event","class":"feature","direction":"notification","transactionId":52301738,"source":"rfProtocol","items":[{"payload":{"featureId":"5c3b515e5e33aa33645653cc-87-3157330816+1","value":3,"status":"ok"},"itemId":2}]}', extra='') 2019-04-09 18:58:53 WARNING (MainThread) [lightwave2.lightwave2] Message with no _feature: {'version': 1, 'senderId': 1, 'operation': 'event', 'class': 'feature', 'direction': 'notification', 'transactionId': 52301738, 'source': 'rfProtocol', 'items': [{'payload': {'featureId': '5c3b515e5e33aa33645653cc-87-3157330816+1', 'value': 3, 'status': 'ok'}, 'itemId': 2}]}

I really really hope this helps you out.