Ok i have tried starting and its still doing the same thing? really strange
Hi Chris - Right i have done some playing around, it all works perfectly when I run node server.js and press on my app lights on/off etc. As soon as i close the window in Raspberry Pi it no longer works. It seems I have to have that window open permanently for it to work.
Does this narrow it down to anything?
If it works when manually running it, this means it is your forever service that isnāt running properly.
The forever service basically takes your server.js and turns into a ārestartable scriptā. If there is a power cut, it will auto-restart.
You can list all forever services running
sudo forever list
You can stop a forever service using this, where 0 is the position in the list (above)
sudo forever stop 0
You can stop a specific forever service using this (in this case the lwrf service)
sudo service lwrf stop
Or you can interact with the LWRF service directly:
sudo service lwrf start
sudo service lwrf stop
sudo service lwrf status
sudo service lwrf restart
Tell me what happens when you run this:
sudo forever list
HI Chris - ok it says No Forever Process running
I tried typing Sudo Service LWRF Start - the re-type sudo forever list and it says the same
Make sure you have installed āforeverā and āforever serviceā. Watch @adamclark_devās youtube video again (this will start at the right part). If you follow this to the letter, it will work.
Ok did that again, and looked into it with more detail and it says this āthis package is no longer maintainedā it didnāt mention that on Adams video?
It doesnāt matter about being deprecated. That just means its not being updated by the developer anymore.
Make sure you are in the folder where the server.js is located. E.g. /var/www/lwrf/
Now, type:
sudo forever-service install lwrf --script server.js
Once its done its thing type:
sudo service lwrf start
And thatās your server running indefinitely ā¦ until you stop it.
sounds silly chris, but how do i locate where the server is?
Type this and press enter:
cd /var/www/lwrf
Then type and enter:
ls
Your should see your server.js in there, if you followed the video to the letter.
I would also recommend this webpage to get familiar with the Raspberry Pi commands.
Ive gone through adams video over and over just incase I have missed something. When I type cd /var/www/lwrf i get this message : no such file or directory.
I guess that is where the problems is
I have messaged you instead.
Sorry new here and suffering from information overload lol. Right I have Smartthings and the newer type hub for Lightwave. 2 questions. 1 can i use this with no pin for the Hub and when I select new device in the IDE I dont have an option from code. Any help appreciated.
Ok managed to sort out the new way to do it on the IDE website and entered everything but not working.Wondering if this is still the pin/password issue
Hi all: thanks so much for all the great content here. Iāve read with interest and are thinking of purchasing LW to work alongside my ST.
I wanted to confirm something here please. I read that the LW interface that Adam has brilliantly put together cannot know if a light is on or off (the LW API doesnāt provide that). Is that correct?
In the demo I watched the LWRF ST app toggles the on / off which can then of course get out of sync if someone uses the physical switch.
So couple of things:
a) is that all still the case.
b) is there a version of the integration that simply has two buttons - that would seemed to avoid any confusion on status.
Thanks very much everyone
Hi there. LightwaveRF does not record it the state of any of its devices, and there is no way to interrogate a device to get its state. You could record the last state somewhere for all commands sent via ST, but that still wouldnāt record those commands sent manually, i.e. when you physically turn on or off the switch in person. It is a pain.
The LightwaveApp gets around the unknown status by offering up 2 buttons; On and Off. Once youāve selected a state it remembers that for the duration of the session. The ST groovy could be updated to swap the single toggle button for 2 separate buttons; On and Off.
Cheers
Chris.
To include simple on and off buttons, you can amend the groovy files as follows:
tiles(scale: 2) {
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.switch.on", backgroundColor:"#79b821", nextState:"off"
attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.switch.off", backgroundColor:"#ffffff", nextState:"On"
}
}
standardTile("on", "device.status", inactiveLabel:false, decoration:"flat",height: 2, width: 2) {
state "default", label:"On", icon:"st.switches.switch.on", action:"on"
}
standardTile("off", "device.status", inactiveLabel:false, decoration:"flat",height: 2, width: 2) {
state "default", label:"Off", icon:"st.switches.switch.off", action:"off"
}
standardTile("register", "device.status", inactiveLabel:false, decoration:"flat",height: 2, width: 2) {
state "default", label:"Register", icon:"http://www.mocet.com/pic/link-icon.png", action:"register"
}
main "switch"
details(["switch", "on", "off", "register"])
}
Hi guys,
Iāve been trying to set this up for some time but seems Iām doing something wrong. From the linux VM were Iām running the node server I can ping the link hub, but seems that the node server code cannot reach it and just retries reaching out all the time (see attached image). Any ideas @adamclark_dev ?
I think has something to do with registering the Node server with the link hubā¦ I read I would need to send it this command to register 001,!F*p
Right direction?