Lightwaverf via Wifi link

Hi,

Ive just installed HA and was hoping to control my lightwaverf sockets and relays. Is this possible without a RFXCOM? If so how do i go about this. Any advice on heatmiser netmonitor v3 (pre Neo solution) would be gratefully received too.

Thanks

Matt

In response to myself, i wrote a bash script and used command line switch to control my lightwaverf kit via UDP.

With reference to heatmiser netmonitor i wrote another bash script to show temperate and state using command line sensor, it wasnt the most elegant solution however it does work.

Matt

Hi Matt

Are you saying you were able to control lightwave sockets via rf link?

Hi,

Yep, i have a simple bash script below

#!/bin/bash

LWHOST=192.168.0.67
LWPORT=9760
ROOM_DEVICE=$1
COMMAND=$2
LWCOM=NOTSET

get_command ()
{
case “$COMMAND” in
“ON”) LWCOM=F1
;;
“OFF”) LWCOM=F0
;;
“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

then in my configuration.yaml i call the script using a command line sensor

platform: command_line
switches:
family_room_tv:
command_on: “/home/hass/.homeassistant/scripts/lightwaverf.sh R1D1 ON”
command_off: “/home/hass/.homeassistant/scripts/lightwaverf.sh R1D1 OFF”
friendly_name: Family Room TV

When you go in the lightwaverf app note down the devices you want to control, the first room in the list is R1, the first device in the room is D1 and so on.

The sleep in the script is to stop commands clashing as i fix the command the sequence number to 101.

I then use hass automation for the schedules which seem more reliable than running via the LW app.

Cheers

Matt

1 Like

Thanks for that!

Do you think this would work with rfxcom ?

you dont need rfxcom, it sends a udp command to the lightwaverf hub

That’s excellent, thanks!

I came here looking for a way to control my LightwaveRF dimmer switches. This works great, & I modified the script a bit so I can set different dim/brightness levels.

Thanks again!

Hi, how did you modify it? I’m trying to get this to work with a dimmer switch and it’s just not playing ball :frowning: It seems to be doing something though as I get an “unknown device” growl in lightwaverf iOS app when I click the switch in the Home Assistant UI.

Have you already linked to your LightwaveRF Link from your Pi?
I did it previously through HA Bridge or homebridge (can’t remember, it was a while ago)

The dimmer command I used before going RFXTRX was like the following:

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

No, I haven’t. I guess I need to do that then (d’oh)! Which method worked for you? Thanks for your help.

I linked through HA Bridge if I remember correctly.

I followed the post of the bottom of this page http://lightwaverfcommunity.org.uk/forums/topic/amazon-echo-dot/
(numbers 6 & 7)

When you send a command for the first time the wifi link shows a message asked to register the controller (assuming you have the original version with the screen).

Matt

do you think the RFXTRX is better than the LightwaveRF Link? how and why?

Thanks.

primarily just because its not reliant on the LWRF cloud that the link is ultimately reliant upon, but it also supports a whole load of other protocols. I don’t like having anything in my home reliant on a cloud server that could disappear, when i’d expect to keep the infra for a good number of years.

Right I see !

Do you have any guides on how to set it up? I intend to use a raspberry pi for this.

Thanks.

Is there any chance someone could put a short guide together to show how to get Lightwave RF system to work in HA

I am looking to take the plunge with Lightwave for a home project and would like to see how I can incorporate it into HA

Cheers

I saved the script above as a shell script, called it ‘ha_lightwaverf.sh’, and placed it in:
/home/homeassistant/.homeassistant/scripts/

Here’s an example of some code I have to create switches for my LightwaveRF lounge and dining room lights:

switch:
  - platform: command_line
    switches:

      lounge_light:
        command_on: "/home/homeassistant/.homeassistant/scripts/ha_lightwaverf.sh R2D1 ON"
        command_off: "/home/homeassistant/.homeassistant/scripts/ha_lightwaverf.sh R2D1 OFF"

      dining_room_light:
        command_on: "/home/homeassistant/.homeassistant/scripts/ha_lightwaverf.sh R2D2 ON"
        command_off: "/home/homeassistant/.homeassistant/scripts/ha_lightwaverf.sh R2D2 OFF"

When I switched on one of these in HA for the first time it sent the command to my LightwaveRF Link hub which (as it wasn't paired to my Raspberry Pi yet) made the hub light start to flash. I pressed the button on the LightwaveRF Link hub which connected/linked my Raspberry Pi to the LightwaveRF Link hub.

I placed the switches in my ‘living room’ group like so:

group:
  living_room_lights:
    name: "Living Room"
    entities:
      - switch.lounge_light
      - switch.dining_room_light
      - light.fireplace_light

thanks for the speedy response on this jono

as a newbie coming into HA, how can I even get my HA instance to recognise the entities (switches/lights) in the first place?

how will my ‘non-smart’ bulbs be detected over the LAN?

I don’t think you can, I think you have to set them up manually like I did by creating the command_line switches.

At the end of the command_on: part you’ll see ‘R2D1’ and ‘R2D2’ parts. This tells the script to turn on/off device 1 (D1) in room 2 (R2) which is R2D1, and in my case I named it ‘lounge_light’ in the code. So the ‘dining_room_light’ is R2D2 (room 2, device 2).

If I remember correctly I found out which device numbers and room number the lights are associated with at LightwaveRF’s web app https://manager.lightwaverf.com. There was a guide somewhere else that said to look in the source code of that web page to find out the device and room numbers.


Don’t forget to change ‘LWHOST=192.168.0.67’ in the code above to use the IP address of your LightwaveRF Link hub.