OK…
I had to completely rewrite this, so basically started from scratch…
The App… How to configure…
Page 1
The on/off switch is Optional but will enable/disable the app as well as switching the LEDs off or on with the ‘dim’ settings
The ‘Dim/Bright’ switch you would configure the virtual switch which is currently controlled by the other app
Obviously the next item is your Fibaro RGBW controller
Page 2
DIM Settings - Select what you want when the virtual switch is OFF - i.e no motion.
If you select ‘Custom Colour’ then you can specify how much % each colour is on
If you don’t need a particular colour then leave set as: 0
BRIGHT settings - Select what you want when the virtual switch is ON - i.e has motion
Again, same rules apply if you select ‘Custom Colour’
Unfortunately, if you select one of the pre-programmed sequences then you cannot alter the brightness levels.
They are either on or off
Page 3
Set a name for the app (optional)
Set where to only operate in certain modes (optional)
Turn ‘Only Allow Actions Between Sunset & Sunrise’ to ON
You should then see some more options…
Here you can set whether to use any ‘Offset’ either before or after sunset/sunrise
Logging. - It doesn’t hurt to turn it on and watch ‘Live Logging’ in the IDE when you first set it up as you can see what has been configured. But I would turn it off after this so you don’t get too many log entries.
You are now done!
Ok… the code is here:
The way I see this working is…
The virtual switch is controlled by your existing app and by the motion sensor on your light
Sunset arrives…, LEDs turn on ‘Dim’
Motion is detected
Existing app turns on virtual switch… LEDs go to ‘Bright’ setting
Motion detector shows movement finished and turns off virtual switch
LEDs go ‘DIM’
Sunrise arrives… turn LEDs off
Try this and see if it works as you expected then please let me know
If I need to ‘tweak’ the operation I can probably do that.
I didn’t add the action for a contact sensor but that should be easy enough to do if you need/would like it
I have it because my bins are outside and it’s nice to set the lights to bright when I open the door
Yup works perfectly Andy thank you very much, i do get a pretty big flicker between original on (deepfade) and movement detect (bright white) but that is more a fibaro mode change issue than code i would imagine
So now i have a front 10w led wash light on sunrise sunset
Led lights sunrise sunset on deep fade
Dumb pir triggering 30w led security light and turning up the leds to bright white which lights up all the darker corners
Movement stops dumb pir times out leds go back to deep fade, security light turns off
Thank you again Andy you are a genius and very patient
You are welcome!
However… the flicker between dim & bright IS configured in the code
It actually switches off inbetween actions
I programmed this as sometimes the DTH gets things wrong and if for example you set dim to red and bright to blue then sometimes it gets mixed up so that you end up with a mix of red & blue.
This may just be an issue with my Fibaro.
If you want to try it without then There is just two lines to comment out
I’ll hunt out the bit of code and let you know what to disable
Ok…
You can just comment out a line by putting // in front of it
So…
fibaro1.off()
Becomes…
// fibaro1.off()
You will find this in two places.
Lines 241 & 256
It’s worth a try as your fibaro might not have the issue that Mine has.
If it starts to play up then just remove the two // and it will activate again.
All is well Andy, thats not to say it wont go odd at sometime in the future but at the moment after editing out the 2 lines transitions are instant and unbroken, cannot thank you enough
I have reset my Fibaro and tried again without the ‘off’ commands
It might just be that I had a ‘glitch’ somewhere in my system, but it works ok for me now too.
I don’t know if you linked to my github or just copy/pasted the code but if I comment the lines out as well then it won’t constantly tell you that it needs updating.
If you ever start seeing that the colours get mixed up you can always uncomment them.
Cobra, do you have any experience with the Fib RGBW 10v inputs ?? i am thinking of adding a temp sensor, with a bit of searching the sensors can be found at resonable prices but i am not sure how the temp sensor displays info in the St fib app or even if it does, just wondering if you have any experience with it
No point going down the purchase install route if St does not have a way to display the info in a useable manner
Unfortunately not on its own
The hue bridge is not a full home automation controller and uses the Zigbee protocol rather than Z-wave which the Fibaro uses.
We are using the smartthings hub to control these which is capable of both protocols.
thanks for the thread
i have read and tried this maybe im missing something
but i can not figure out how to get the rgbw to set a colour when motion is detected
what i want is button/motion to turn on lights whith whichever colour i set for that time of day
or alternativley
button to sett normally white and a routine called bathtime to set a colour at a preset level
Apologies.
I have the controller and a physical button or a motion sensor. Ie:not virtual.
But when it triggers or is pressed it will not set the colour.
Ideally what I want is to have white when motion or button is pressed.
And a routine to set it as colour.