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.
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.
@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!!
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
Loving the idea of the message queuing, but can anyone turn this into a component for Hassio??
My limited knowledge means trying to install rabbitMQ on my hassio box is beyond me without instructions!
Big old pretty please (with sugar on top)!
+1 all this looks really cool but installation guide is wellā¦ really long guide and surely something goes wrong at some point there and i dont have enough skill to fix it. So i wonder if someone can make it available as an official home assistant component. Thatād be so awesome.
Btw currently im using command line approach that was discussed in this topic about a year ago. I use this in configuration.yaml:
- platform: command_line
switches:
stairs_light:
command_on: "/home/homeassistant/.homeassistant/ha_lightwaverf.sh R3D1 ON"
command_off: "/home/homeassistant/.homeassistant/ha_lightwaverf.sh R3D1 OFF"
and this is ha_lightwaverf.sh script:
#!/bin/bash
LWHOST=192.168.0.11
LWPORT=9760
ROOM_DEVICE=$1
COMMAND=$2
LWCOM=NOTSET
get_command ()
{
case "$COMMAND" in
"ON") LWCOM=F1
;;
"OFF") LWCOM=F0
;;
"D10") LWCOM=FdP3
;;
"D15") LWCOM=FdP5
;;
"D40") LWCOM=FdP13
;;
"D50") LWCOM=FdP16
;;
"D80") LWCOM=FdP26
;;
"D100") LWCOM=FdP32
;;
"LOCK") LWCOM=F.
;;
"STOP") LWCOM=F.
;;
esac
}
run_command ()
{
echo ${LWHOST}
echo ${LWPORT}
echo ${ROOM_DEVICE}
echo -ne "101,!${ROOM_DEVICE}${LWCOM}|" | nc -w1 -u ${LWHOST} ${LWPORT}
sleep 1
}
get_command
run_command
So basically while bash script is capable of dimming i canāt really dim it because in the config it is switch on/off. Is there a way to change the config so it can dim too?
Thanks,
Alex
Not as far as Iām aware.
The way I do it is to create a few different switches with different brightness levels (10%, 30% 60%) and then either turn on those switches from scenes, scripts or Google Home/Alexa/Siri.
try 001 rather than 101ā¦ this is how I had it working before I shifted to vera with an RF transmitter
echo -ne "001,\!R$1D$2FdP$DIM|$4" | nc -u -w1 x.x.x.x 9760
and I had an additional slider with the switch in a group to allow for dimming with values from 0 to 32
I also used 001 for the switch on/off btw
echo -ne "001,!R$1D$2F$3|$4"
Hi Guys,
Currently working on updating this. I have the some code working with this. Uses threads and queue and is very responsive. The mistake in the original code was not waiting for an āOKā from the hub. Iāll post my updates up this evening. It is a single module and does not need additional things to be installed such as RabbitMQ.
Looking to create a docker image to easy installation. Any hints for the how to get a dialog to pop-up for the hub configuration would be greatly appreciated. Iād like to get this working in a similar manner to how the Hue bridge asks the user to press the button on the hub.
Going further, I think, with the json responses from the hub, it would be possible to perform some sort of auto discovery but I have not had time to confirm this.
Cheers,
Geoff
Watch this space - I hope to get round to making the installation easier sooner rather than later.
Controlling the brightness of the lights can be done a script. You can easily create a script for each mood.
This sounds great, looking forward to this!
At the moment Iām using Home Assistant in a Docker container, and Iāve not been able to find a way to pair with the LightwaveRF Link hub with Home Assistant within Docker.
Iāve ended up running Homebridge with the Homebridge Config UI X plugin, which allows you to run Terminal commands within Homebridge, and that allowed me to pair the hub to Homebridge (also running in a Docker container).
This sounds cool - the messages not queueing at the moment in my system is a real pain.
Iām using Hassio though - will this be easy to add to Hassio? Any chance of a component???
Iām using hassio and running as a customer component. Once complete I hope to move it to the community store for easier download an installation. Still finding my way round the code base and really wish someone would review my code and make suggestions for improvements.
While what I have works for me it may not be correct.