Announcement

Collapse
No announcement yet.

Gosund WiFi dimmers (ESP8266 based) any experience out there

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

    #16
    Search for Tasmota Rules Cookbook. The scripting using rules was enabled around Tasmota version 6.5 so you have it with 8.5

    Comment


      #17
      More..... Upgraded to minimal version 8.5.1 to subsequently accommodate the larger "scripring" version. Now I'm stuck at Tasmota Minimal version. Wouldn't upgrade to Tasmota"s scripting version. Trying this source - no luck

      https://github.com/tasmota/binaries/...ripting.bin.gz

      Comment


        #18
        Here used the GZ minimal version and the unzipped scripting version.

        From my Cocoontech post:

        02, July 2020

        Was able to load the tasmota scripting bin initially loading the tasmota basic bin gz file then uploaded the script bin.

        4 - update firmware on switch over to Tasmota Scripting bin (GZ file) - this is where I started, but it would not accept the Scripting bin. So I installed the tasmota-minimal.bin.gz and then installed the scripting bin. This allowed for the Scripting option which I had not seen before.

        Adding the script and template found here ==> hxxps://templates.blakadder.com/gosund_SW2.html have the switch working fine now.

        If that doesn't work reload the GZ basic BIN then try again with the GZ scripting bin.

        Dave on Cocoontech adjusted the original script a bit:


        hxxp://cocoontech.com/forums/topic/32175-gosund-wifi-dimmer-replacing-firmware/?p=271309

        Here is the original scripting bin file I used in June.

        Attached Files
        - Pete

        Auto mator
        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
        HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

        HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

        Comment


          #19
          Thinking now that the original minimal bin did not let me install the scripting bin so reloaded the minimal bin using the gz file; then was able to load the scripting bin file. I do not know why this worked.

          I also purchased a couple of the regular Gosund non dimmable switches and put Espurna on those. (garage interior lighting and backyard spot LED lamp). There is no Espurna firmware for the Gosund dimmable switch. That said I was impressed with the newest Tasmota firmware features.

          Tried using OTA way back and had issues with it so JTAG'd all my stuff which for me was easy. This time around the OTA python script worked well.

          Initially had no automation software running in house #2 and used the built in schedulers. Built a small infrastruction at house #2 using a PFSense firewall, 16 port managed POE switch and Ruckus WAP.

          Click image for larger version  Name:	espurnaGoSund.jpg Views:	0 Size:	58.4 KB ID:	1429345
          - Pete

          Auto mator
          Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
          Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
          HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

          HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
          HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

          X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

          Comment


            #20
            Pete The file you provided did magic. I managed to update to "scripting version" after everything else failed including "official" versions and "unofficial" versions from GitHub. Working on the scripting now....

            Comment


              #21
              Hurray !!! Tasmota controls the Gosund dimmer now after uploading the corrected version of Dave's script. Here it is for reference if someone else is doing it.


              >D 100 rng=235 dimh="" slider=0 power=0 dimval=1 a="" b="" c="" d=0 f=0 ;set the hex code below to the largest value possible that will turn off the relay with SerialSend5 off=0x7f >B dp0 rng-=off =#scDim(dimval) >E a=SerialReceived if sl(a)>0 then if sl(a)==47 then b=sb(a -5 2) else b=sb(a -8 2) endif a="" f=hd(b) =>dimmer %f% slider=f dimval=slider =#scDim(dimval) =>SerialSend5 %dimh% else slider=Dimmer if chg[slider]>0 then ; dim according slider if slider>0 and dimval!=slider then dimval=slider =#scDim(dimval) =>SerialSend5 %dimh% endif endif endif if pwr[1]!=power then if pwr[1]==1 then =>SerialSend5 %dimh% power=1 else =>Serialsend5 00 power=0 endif endif #scDim(dimval) dimh=hn((rng*dimval/100)+off) =>print Scaled brightness is %dimh%

              Comment


                #22
                The question now is how to make HomeSeer control the dimmer ? I assume there are some Tasmota commands that I need to send over MQTT. Correct?

                Comment


                  #23
                  >D 100
                  rng=235
                  dimh=""
                  slider=0
                  power=0
                  dimval=1
                  a=""
                  b=""
                  c=""
                  d=0
                  f=0
                  ;set the hex code below to the largest value possible that will turn off the relay with SerialSend5
                  off=0x7f

                  >B
                  dp0
                  rng-=off
                  =#scDim(dimval)

                  >E
                  a=SerialReceived
                  if sl(a)>0
                  then
                  if sl(a)==47
                  then
                  b=sb(a -5 2)
                  else
                  b=sb(a -8 2)
                  endif
                  a=""
                  f=hd(b)
                  =>dimmer %f%
                  slider=f
                  dimval=slider
                  =#scDim(dimval)
                  =>SerialSend5 %dimh%
                  else
                  slider=Dimmer
                  if chg[slider]>0
                  then
                  ; dim according slider
                  if slider>0 and dimval!=slider
                  then
                  dimval=slider
                  =#scDim(dimval)
                  =>SerialSend5 %dimh%
                  endif
                  endif
                  endif

                  if pwr[1]!=power
                  then
                  if pwr[1]==1
                  then
                  =>SerialSend5 %dimh%
                  power=1
                  else
                  =>Serialsend5 00
                  power=0
                  endif
                  endif

                  #scDim(dimval)
                  dimh=hn((rng*dimval/100)+off)
                  =>print Scaled brightness is %dimh%

                  Comment


                    #24
                    Better formatted script is attached above

                    Comment


                      #25
                      I find 2 major problems after playing with Gosund dimmer modified with Tasmota and the script above

                      1. Gosund's manual controls do not work anymore. The dimmer is well controlled over Tasmota web GUI but the manual controls do not work.
                      2. MQTT control and feedback is complicated as it is topic driven. There is a topic for everything making the number of topics reach 10 or more per device. So for an average house with say 25 dimmers/switches you'll end up with over 250 topics to deal with. This is NOT the idea of MQTT. I'd rather see fewer topics and payload driven information

                      Example:

                      As is now

                      To turn the light on at Dimmer1 you need to post message "on" to MQTT topic cmnd/Dimmer1/POWER

                      Better solution

                      Post message "Dimmer1 on" to a topic that serves all dimmers in the house for example cmnd/POWER

                      Question to those who are more experienced than me. Is this doable in Tasmota?

                      Comment


                        #26
                        Gosund's manual controls do not work anymore. The dimmer is well controlled over Tasmota web GUI but the manual controls do not work.

                        Make sure you have enabled the template and the script.

                        The script is what enables manual control of the switch.

                        The template and original script are here:

                        hxxps://templates.blakadder.com/gosund_SW2.html

                        Odd that the zipped script bin file from Tasmota repositories did not work. I used the development repository for the script bin file and I though they moved that one over to the regular depository.

                        1 - template ==>
                        {"NAME":"Gosund Dimmer","GPIO":[255,148,255,149,17,0,255,255,56,158,37,255,255],"FLAG":0,"BASE":18}

                        Right below the template is a check box to enable the template. Then hit save on the bottom of the page.

                        Click image for larger version  Name:	template-activate.jpg Views:	0 Size:	31.9 KB ID:	1429485

                        2 - You can try the original script. Make sure you save it too.

                        Both let me manually control the dimmer. The dimmer is a touch sensitive bar. Just touch it and slide your finger up or down and the LED lights will follow you finger. The toggle only works on the bottom of the switch and only turns on and off the switch. It will remember last dim level. Just slide you finger along the LEDs to dim or brighten the lamp connected to the switch. I have never seen a switch like this. (well here only have UPB in wall switches and house #2 doing only Gosund switches.)

                        Click image for larger version  Name:	Tasmota-script.jpg Views:	0 Size:	65.1 KB ID:	1429486

                        Dave only tweaked the original script ==>

                        Code:
                        >D 100
                        rng=235
                        dimh=""
                        slider=0
                        power=0
                        dimval=1
                        a=""
                        b=""
                        c=""
                        d=0
                        f=0
                        ;set the hex code below to the largest value possible that will turn off the relay with SerialSend5
                        off=0x7f
                        
                        >B
                        dp0
                        rng-=off
                        =#scDim(dimval)
                        
                        >E
                        a=SerialReceived
                        if sl(a)>0
                        then
                        if sl(a)==47
                        then
                        b=sb(a -5 2)
                        else
                        b=sb(a -8 2)
                        endif
                        a=""
                        f=hd(b)
                        =>dimmer %f%
                        slider=f
                        dimval=slider
                        =#scDim(dimval)
                        =>SerialSend5 %dimh%
                        else
                        slider=Dimmer
                        if chg[slider]>0
                        then
                        ; dim according slider
                        if slider>0 and dimval!=slider
                        then
                        dimval=slider
                        =#scDim(dimval)
                        =>SerialSend5 %dimh%
                        endif
                        endif
                        endif
                        
                        if pwr[1]!=power
                        then
                        if pwr[1]==1
                        then
                        =>SerialSend5 %dimh%
                        power=1
                        else
                        =>Serialsend5 00
                        power=0
                        endif
                        endif
                        
                        #scDim(dimval)
                        dimh=hn((rng*dimval/100)+off)
                        =>print Scaled brightness is %dimh%
                        As for controlling the switch with Homeseer use Michael's mcsMQTT to create dimmable light switches.



                        One reason I like Espurna is that it creates the command for you.

                        Here is a modded SonOff 1-wire device with MQTT commands presented in the web gui.

                        Code:
                        switch:
                        - platform: mqtt
                        name: Espurna_1WIREA
                        state_topic: Espurna-1WIREA/relay/0
                        command_topic: Espurna-1WIREA/relay/0/set
                        payload_on: 1
                        payload_off: 0
                        availability_topic: Espurna-1WIREA/status
                        payload_available: 1
                        payload_not_available: 0
                        
                        
                        sensor:
                        - platform: mqtt
                        name: Espurna_1WIREA_temperature
                        state_topic: Espurna-1WIREA/temperature/0
                        unit_of_measurement: °F
                        
                        - platform: mqtt
                        name: Espurna_1WIREA_temperature
                        state_topic: Espurna-1WIREA/temperature/1
                        unit_of_measurement: °F
                        
                        - platform: mqtt
                        name: Espurna_1WIREA_temperature
                        state_topic: Espurna-1WIREA/temperature/2
                        unit_of_measurement: °F
                        
                        - platform: mqtt
                        name: Espurna_1WIREA_temperature
                        state_topic: Espurna-1WIREA/temperature/3
                        unit_of_measurement: °F
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                        HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                        HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                        Comment


                          #27
                          Pete Thanks for the hand holding. I really appreciate it. I have done all of the above actually. I did it again and again no manual control. More specifically it will dim the light up and down as my finger slides over the faceplate, however light turns off immediately when I remove the finger and stays off no matter what I do manually at the switch. Tried with the old and the new script. BTW I noticed that the binary file that you provided took me to an earlier version of Tasmota 8.3.1.6 but as I said above this was the only way to go to the script enabled version of Tasmota.

                          Comment


                            #28
                            Also noticed that my Template screen looks different than yours. It is actually under "Configure other" in the menu

                            Click image for larger version  Name:	Screenshot (310).png Views:	0 Size:	32.8 KB ID:	1429497

                            Comment


                              #29
                              If I go to "Configure template" than I see different thing. Do I need to do something here?

                              Click image for larger version

Name:	Screenshot (312).png
Views:	396
Size:	44.6 KB
ID:	1429500

                              Comment


                                #30
                                .... and there is yet another setting "Configure Module" that looks like this. Strangely it mentions "Sonoff basic" as I never touched anything related to Sonoff in the config. Do I need to do something here???

                                Click image for larger version

Name:	Screenshot (314).png
Views:	352
Size:	30.4 KB
ID:	1429506

                                Comment

                                Working...
                                X