Lightwaverf via Wifi link

That would be great - are you using bash scripts as above, or have you written a “proper” plugin for this?

Hey jono,proffalken
i tried your scripts:

  • downloaded and replaced ip address
  • placed it on my raspberry pi
  • run it like this from the OSX terminal:
    bash ha_lightwaverf.sh R1D1 ON

Script runs with the following output and no errors:
192.168.1.110
9760
R1D1

However, lights do not switch on and lightwaverf link doesn’t start blinking.

I wonder what am i doing wrong. Appreciate any help/ideas.

Thanks,
Alex

Did you link the LightwaveRF Link (hub) to your Mac or Raspberry Pi before trying the scripts?

Try running this in Terminal on your Mac or Raspberry Pi, and see if the green light on the LightwaveRF hub flashes (so you can press the button and link the hub to your Mac/Pi).

echo -ne "100,\!F*p." | nc -u -w1 192.168.1.110 9760

1 Like

Great! I Was missing this bit indeed. It works now. Thanks a lot!

Alex

Glad to hear it :+1:t3:

I’ve written a proper plugin. Will get the code in order and put on github soon.

1 Like

That would be amazing, thanks - I’ve not had anywhere near as much time to spend on this as I would have liked :frowning:

@mhaylock @jono @glen @pembo @litfoo @CaptainComedy @grooml @SCCMOG @alexbell

I’ve made my integration available for you. It’s a bit crude, but should work. Any questions let me know.

If there’s demand for this then I’ll spend time making it better.

C

This really is a great piece of code…!
Only issue I have is turn on multiple.
Have you managed to get round this issue?

For example…
Create a group in Alexa… using 2 of the lights created by your component (or by my CMD line switches).
Then ask Alexa to turn on the group…
Boom only ONE turns on…
First idea… create an automation… issue solved right? No, how do you then DIM multiple lights by for example.

If you’ve found a way round give me a shout mate, I have been messing with this with my scripts and now yours and just cant get multiple to turn on…

Cheers,
Richie

Thanks! I’m glad it was useful for you.

I didn’t have a lot of time to make the multiple work, but I did find a work around in scripts.

I am currently using scripts where turn on / turn off / dim EACH light ONE BY ONE.
You have to wait a second between each light as the hub doesn’t like receiving multiple commands at once.

It’s not elegant or efficient, but it does the job.

I’m not near my home assistant install at the moment so I can’t show you my script, but next time I am near, I’ll upload a snippet for you to look at. Let me know how you get on.

C

Building on the work by Chirag Desai.


This could have been done in a single component but I am too new to home assistant to know when a composite component should be used.

1 Like

@GeoffAtHome I’d like to say a big thanks to you for this!

I have installed both integrations as I have many switches dimmers and open/close devices throughout the house. On the whole - it looks to be working great.

One thing that I have noticed is that if you turn on / off a group of lightwave devices, the outcome is sketchy! I’m sure that this is due to the lightwave hub trying to send out multiple commands at the same time. Other than adding delays in the automation, is there any way around this? It would be nice to be able to just click on the groups toggle and get them all changing state, and especially nice not to have to add loads of delays to my automation / script code everywhere!!

@GeoffAtHome Also - any idea what the min & max brightness of the lightwaverf lights?

Hi Martin,

My understanding from the documentation here is the value is 0 for off and 1 to the max of 32.

The code I have added does this in the calculate_brightness function.

Cheers,
Geoff

Yep - I have noticed this too. At the moment this can be fixed with automation but now that python 3.4 has been removed I plan to upgrade using Asyncio and queue the command with a delay between them. Easier said than done. This is the plan in reality I need to figure out how this can be implemented.

@GeoffAtHome got this working for my sockets - works brilliantly. If I want to label some as switches and some as lights do I need to replicate exactly?

I created two versions. One for switches and one for lights. If you have lights only used the lights. If you have switches only use the switches. If you have both…use both.

Hi Chillerz,

Just to say i have built on your custom components for LightwaveRF gen 1 devices.
It uses a queuing system to stop any commands not hitting the wifi link.
It is also fully configurable in Configuration.yaml
The lights are fully dimmable as well and it also works well with Alexa and Google home when emulated hue is enabled.
please let me know what you think.
The install guide is located in the root of the github post, it is an exact step by step of how to install and configure EVERYTHING!

Cheers,
Richie

guys

nice work. I have it all working using GeoffAtHome/lightwaverf-home-assistant-switch and all works well, I was looking at SCCMOG’s work with RabbitMQ and was wondering to myself, why do we need a queuing system? Is there an issue here? From what I can see the packets would hit the link and then be processed by the link… I didnt think we had any issues…

but I might be

Any other plans to put one of these as an official platform in HA?

There’s definitely issues in multiple requests hitting the hub at the same time, and I too was surprised to discover it.

I used shell scripts to do this originally, and had lots of issues if multiple devices hit the hub concurrently (E.g. if I switched off a whole group). I got around this lazily in the scripts by using a file based lock and scripts wait on the lock, but it’s not the best approach for a real component. This would need a proper queueing system as a better choice, but I guess rather than using RabbitMQ, you could potentially use one of the python mechanisms, e.g. https://docs.python.org/3/library/queue.html to minimize external dependencies