Announcement

Collapse
No announcement yet.

Under kitchen cabinet LED lamps with mcsMQTT control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #61
    Redoing the office lighting updating the UPB switch to a double toggle switch as I was using the current toggle linked to the light module for LED use.

    Did a drawing of my connections. Reprograming the switch pictured and will remove current switch and replace it with said switch.

    Click image for larger version  Name:	OfficeLighting.jpg Views:	1 Size:	158.3 KB ID:	1248910

    Might change the switch configuration to a relay configuration then install a small LED transformer and connect it to a 12 VDC LED pot to hard set dimming. Well might move the combo Sonoff SV device that I made there.

    Using Upstart noticed that I have a universal UPB base mounted on the switch. Just changed removed the single toggle face plate and installed a dual toggle face plate. Easier than removing the switch and replacing it. Programmed the two toggles on it with the bottom toggle controlling the light module over the book shelf. I cannot change one toggle to a relay such that the switch has to function as a dimmer or relay but not both.

    Found out with the new dimmable power supply I cannot dim up to whatever over 5 seconds without the LED's flickering. If I set the dim level to instant then I get no flickering of the over the shelf LED lamps.
    Last edited by Pete; September 22nd, 2018, 03:26 PM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
    Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

    Comment


    • #62
      Pete, Have you looked at the Rules in Tasmota, we should be able to add a pot to a gpio and use it as a variable to set the dimmer on the same device (or others). With the 801 controller it should be easy enough to wire up, also these modules can be setup as a single color controller allowing the use of those other gpios.
      I had the same troubles trying to dim transformers and ended up with a manual pot for some lights which was fine anyway.
      John

      Comment


      • #63
        John....I have not looked. There is enough room in the 801 controller case for a pot. Do you have a schematic for this control?

        I was going to switch out the Sonoff SV combo manual dimmer pot for the newly updated RGB controller using one channel for dimming.

        So what does work so far is:

        1 - combo SV and manual pot for dimming remembers last dim level which is fine except that I dim one LED set of lamps every night.

        2 - new dimmable transformer work fine with my UPB combo switch. That dimmable transformer and UPB light module are on top of the 7 foot high book shelves such that I will be leaving the control alone for time bean. The double decora UPB paddle works great. Bottom paddle just sends links (on, off, dim level) to the lamp module on the top of the book shelf.

        3 - RGB 801 5 channel controller (mosquitto) works fine with one channel except I have no manual control on it. It does remember the dim level if I power off the device.

        I have a few shelves here with LED 120VAC powered cob lights first generation. They sort of work but only offer one dim level.

        One is a wood and glass curio cabinet and the others are large wood cabinets with glass shelves. I am wondering if I could convert these to 12 VDC cob style and dimmable LED lamps (not strips). I do not think though that 120VAC style bulbs with E bases are sold as 12VDC style bulbs.
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
        Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

        Comment


        • #64
          Pete, on the wiki there is a link to examples under the Rules link to the right
          6. Use a potentiometer

          Connecting a potentiometer to the Analog A0 input and a rule can be used to control the dimmer state of any device.

          Hardware
          • Wemos D1 mini
          • Potentiometer of 2k2 connected to Gnd, A0 and 3V3
          • WS2812 led

          Software
          • Sonoff-Tasmota v5.12.0n or up with define USE_RULES enabled

          Rule
          • on analog#a0div10 do dimmer %value% endon

          Result
          • Turning the potentiometer the voltage on the analog input will change resulting in a value change of 0 (Off) to 100 for the trigger. Using this value to control the dimmer of the WS2812 will control the brightness of the led(s)

          Rule
          • on analog#a0div10 do publish cmnd/grouplight/dimmer %value% endon

          Result
          • This time all lights configured with GroupTopic grouplight will change their brightness according to the potentiometer position.

          Might just be the ticket here.

          John

          Comment


          • #65
            Thank you John.

            Looking at the close up drawings. I did wire up GPIO 16 D0 ESP8266EX on the SonOff WiFi board. Ground and 3.3VDC are the easy connects.


            Click image for larger version  Name:	H801-GPIO16.jpg Views:	1 Size:	82.9 KB ID:	1249211

            Geez using Visio on Ubuntu via PlayOnLinux and getting MS Office pop ups??

            xxxxxxxxxx
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
            Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

            Comment


            • #66
              Pete, Was reading and now I lost it, the analog voltage input limit is 1 volt, so you need something to limit or divide your pot output I think.
              Another option for you might be just setting up more switches and using them as presets for your dimming, On/Off and High/Low or whatever.

              John

              Comment


              • #67
                The current under the counter strip with diffuser is about 1/2" in size. Running another strip next to it would not really be noticed except for the ultra bright white lite under the kitchen cabinet. I could just put two micro switches to the fixed output of two tracks with one left at daytime 100% and the other at nightime 40% or go the analog way (but it is a bit too much now for this endeavor). Wife is happy right now with the Sonoff SV and the wall switch and the pot on the case to dim it down.
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
                Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                Comment


                • #68
                  Pete, A couple of my MagicHome controllers have IR built in so I went back and flashed ESPurna again and dug out the remote for it, The remote works like factory stock (on/off, dim up/down, and color choice) with the ESPurna firmware. So on my gas pumps I am adding an IR receiver to each controller which will give me full local control (manual) and full automation control also. When the remote is used MQTT updates HS3 instantly, so its almost perfect. I believe the Tasmota firmware will handle IR also but you need to define everything in rules, but you can use any remote control you have.
                  Time to move on, lol.

                  John

                  Comment


                  • #69
                    Yes it is John.

                    What I have installed works, WAF is high and is simple. No need to complicate it. Time to move on to finish my new SonOff based 1-Wire stuff.

                    - Pete

                    Auto mator
                    Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
                    Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

                    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                    Comment


                    • #70
                      Pete, I figured it out using a rotary encoder, works nice. I flashed Espurna using gpio's 0,2,4 for the encoder on a Magic Home controller.
                      On/Off and dimming all on one knob for a couple bucks.
                      https://www.youtube.com/watch?v=TwK5t6esXu0

                      John

                      Comment


                      • #71
                        Great stuff!!!

                        Thank you John.

                        Posted your video here.



                        Where can I get the on/off and dimmer pot?

                        Do you have a schematic for the pot / switch wiring?

                        Did you modify the Espurna firmware?
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
                        Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

                        X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                        Comment


                        • #72
                          Can you easily read the GPIO pins ?
                          Seems perfect for my garage door project ...

                          Comment


                          • #73
                            I can see them fine on the H801 RGB board which is larger than the Magic Home RGB board.

                            Will just follow the traces with a VOM to hopefully solder using a pin hole rather than the ESP chip.

                            Here for the Garage lighting switched over to multiple 120 VAC 6000k LED lamps for that daylight look last year.

                            Ideally it would be nice to change over to using 12VDC for these lighting.
                            - Pete

                            Auto mator
                            Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU - Mono 6.00
                            Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro - Mono 6.00

                            X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                            Comment


                            • #74
                              Sorry for the delay, I received some new controllers the next morning and I wanted to do it again before I posted. Well of coarse it could not go that easy, the new controllers are different but it worked out better really.
                              Click image for larger version

Name:	Magichome new and old.jpg
Views:	54
Size:	171.7 KB
ID:	1251587

                              The new controller (left) has only the chip, and well I can't solder to that little thing. I decided to try another route after reading tons on Github and use the Rx and Tx pads and the IR pad.

                              Click image for larger version

Name:	MagicHome new back.jpg
Views:	51
Size:	92.6 KB
ID:	1251588

                              This makes for a simple setup with lots of devices as they all use gpio 1,3 for flashing and most have access to another gpio (I did use gpio 0 for the button and all was fine, I think that might need more tweaking in the Espurna code as I think it will reset the board if held long enough, gotta check on that)

                              Click image for larger version

Name:	Magichome new wiring.jpg
Views:	64
Size:	225.8 KB
ID:	1251589

                              I went ahead and brought all four gpio's (0,1,3,4) out of the controller along with ground, if I need to reflash it will be simple and I might be able to use the 0 pin also.

                              Click image for larger version

Name:	Magichome new open.jpg
Views:	50
Size:	209.2 KB
ID:	1251590

                              This controller came with the IR receiver so it was simple again to snap it together with a hole for the wiring already there. The only mod I needed was to clip a tiny corner off the interior plastic board locators, the ground wire was holding the board at an angle, again really simple.


                              Click image for larger version

Name:	Rotary encoder.jpg
Views:	38
Size:	221.9 KB
ID:	1251591

                              This is the rotary encoder I used, already had for a Squeezebox project, has five pins, 3 on side you can see here and two opposite for the push button, the 3 pins are simple again center to ground and 2 others to a gpio each, it all gets set up in the Espurna code. The hardware was really simple




                              I used a couple servo extenders from the parts box and just removed the black wire from the cable with gpio 0 and 4, the other has ground and the 2 gpio's for the encoder.


                              Click image for larger version

Name:	MagicHome setup with encoder.jpg
Views:	42
Size:	164.6 KB
ID:	1251592

                              I soldered the short ends from the servo cables to the encoder, added a little shrink tubing it was done. If I need to extend it I have those extensions in different lengths so again simple. The aluminum knob came from Amazon also, I ordered a few more different ones, I'll post those when they get here.

                              I'll post the software side shortly.

                              John

                              Comment


                              • #75
                                Ok, I had just setup a new Raspberry running Picoreplayer and used a rotary encoder to handle to the volume and thought this would be perfect for these led controllers. Next step I searched Espurna and rotary encoder, seems there is a light out there that has a rotary encoder built in with a esp8266 running it, the Xiaomi Smart Desk Lamp. It has White leds and Warm white leds. Following the search I found he added support for it in the latest build, not sure if it was tested but it was there.
                                When you build your own firmware in Arduino you edit the arduino.h file and setup the build. The device you define in that file reads definitions from the hardware.h file (these are in the config folder under Espurna code) and you set your gpio's buttons, relays and such. Looking at the code for the Xiaomi lamp I just copied the parts I needed and setup my own device at the end of that file. I went back to the arduino.h file and defined the new device i created MH_ENCODER with my settings.

                                Click image for larger version

Name:	hardware h 1.PNG
Views:	40
Size:	174.3 KB
ID:	1251602
                                Click image for larger version

Name:	hardware h 2.PNG
Views:	42
Size:	181.1 KB
ID:	1251603
                                Pete you may like this part, in the code for the Xiaomi lamp the rotary encoder sets the brightness of all channels, when the knob is held pressed and turned it varies the first 2 channels opposite each other, one up the other down, kinda nice for getting right shade of white I guess but not so good for RGB. Also it has code for a hidden button that resets device, I just commented button 2 out all was good there.
                                The other thing was, I did not install the functions for serial comms to use gpio's 1 and 3, I learned that when the device is booted with gpio 0 grounded the Rx And Tx functions are activated and it flashes the same. I need to check the exact setting I used and post them, it took a few times to get the build I wanted.
                                I'm not a programmer but I can cut and paste with the best of them, basically lots of trial and error. There are other settings in the encoder.ini file but I have not messed with that yet.

                                I found that ESPeasy supports rotary encoders too so I flashed that on a Nodemcu and was connected to HS3 in minutes with MQTT, it setup a device that read 0-100 from the encoder with very fast updating to HS3. I don't think ESPeasy works on these ledcontrollers but with a Nodemcu you can do alot with ESPeasy.

                                Learning alot here! If I left something out or there something more, please post it.

                                John

                                Comment

                                Working...
                                X