Sonoff 4CH with ESPEasy

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#81 Post by stofakiller » 21 Sep 2017, 15:07

Hi,

I have a 5-32v Sonoff/Itead 4ch, but i cant figure out how to flash it. I have flash many types of Sonoff's, i have Sonoff POW, normal 1ch Sonoffs and bulbs... I have triede both thrue my Arduino to flash it and also tried to erase it with ESP_Basic_Flasher... I always get cant open the port. Anyone triede or have any suggestions?
sonoff-4ch.jpg
sonoff-4ch.jpg (1.98 MiB) Viewed 49649 times

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#82 Post by manjh » 21 Sep 2017, 15:11

Are you sure this is a Sonoff 4CH? It looks totally different from the two units I have. I see no buttons, for example.
Also, my Sonoff has a mains connection from which it feeds. Looks like this one expects an external power supply!

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Sonoff 4CH with ESPEasy

#83 Post by Shardan » 21 Sep 2017, 17:40

Definitely that is not a genuine Itead 4ch.

Anyways an interesting module.
Do you have a link or schematics?
I'm not able to identifythe cpu module, it might contain an esp, not sure.
It might contain a signal cpu too.
Regards
Shardan

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#84 Post by manjh » 21 Sep 2017, 17:41

Shardan wrote: 21 Sep 2017, 17:40 Definitely that is not a genuine Itead 4ch.

Anyways an interesting module.
Do you have a link or schematics?
I'm not able to identifythe cpu module, it might contain an esp, not sure.
It might contain a signal cpu too.
A picture of the external casing might help, plus an accurate type/model number.

stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#85 Post by stofakiller » 22 Sep 2017, 11:09

I bought true banggoodhttps://www.banggood.com/USB-5V-Or-DC-7 ... 84201407E9

That was back in may, i can see now that they have changed the product name to Geekcreit. It still uses Sonoff's app. But i would like to control it my self with mqtt :-)

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Sonoff 4CH with ESPEasy

#86 Post by papperone » 22 Sep 2017, 11:30

maybe just the WiFi module is from itead --> https://www.itead.cc/psb-04.html
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#87 Post by stofakiller » 25 Sep 2017, 09:53

I found the solution here: viewtopic.php?t=2721#p13583

I'm trying to flash it later today :-)

stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#88 Post by stofakiller » 25 Sep 2017, 18:55

It's a different chip, psf-b85 https://www.itead.cc/wiki/File:Pins_map_PSF-B85.png

So i'll try flashing it, all the pins i need is on one sideof the pcb...

stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#89 Post by stofakiller » 26 Sep 2017, 17:34

I did'nt, i think the image is from the pcb side, and i think i was right, i just found this image Image

stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#90 Post by stofakiller » 29 Sep 2017, 11:55

It worked :-)

Its a 8266 chip and works perfect as a Sonoff 4ch PRO module

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#91 Post by grovkillen » 29 Sep 2017, 12:20

Ah, cool! I will order one to test :) Thanks.

(AliExpress link: http://s.click.aliexpress.com/e/eYfIy76)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Sonoff 4CH with ESPEasy

#92 Post by Shardan » 29 Sep 2017, 13:11

stofakiller wrote: 26 Sep 2017, 17:34 I did'nt, i think the image is from the pcb side, and i think i was right, i just found this image Image
Which device is that? It's not the 4ch switch showed above, isn't it?
Regards
Shardan

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#93 Post by grovkillen » 29 Sep 2017, 13:29

Shardan wrote: 29 Sep 2017, 13:11 Which device is that? It's not the 4ch switch showed above, isn't it?
It's the "Successful Case" explained here:
https://www.itead.cc/psb-04.html

A ton of itead based OEM modules are found here: http://s.click.aliexpress.com/e/vJMNjuj
Last edited by grovkillen on 29 Sep 2017, 13:30, edited 1 time in total.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

stofakiller
New user
Posts: 7
Joined: 03 Aug 2016, 19:19

Re: Sonoff 4CH with ESPEasy

#94 Post by stofakiller » 29 Sep 2017, 13:30

Shardan wrote: 29 Sep 2017, 13:11
stofakiller wrote: 26 Sep 2017, 17:34 I did'nt, i think the image is from the pcb side, and i think i was right, i just found this image Image
Which device is that? It's not the 4ch switch showed above, isn't it?
No, it's this one, frome my earlier post here viewtopic.php?f=5&t=2616&p=19423#p19212

And i flashed it with Tasmota firmware https://github.com/arendst/Sonoff-Tasmota
Last edited by stofakiller on 29 Sep 2017, 15:09, edited 1 time in total.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Sonoff 4CH with ESPEasy

#95 Post by Shardan » 29 Sep 2017, 14:52

grovkillen wrote: 29 Sep 2017, 13:29
Shardan wrote: 29 Sep 2017, 13:11 Which device is that? It's not the 4ch switch showed above, isn't it?
It's the "Successful Case" explained here:
https://www.itead.cc/psb-04.html

A ton of itead based OEM modules are found here: http://s.click.aliexpress.com/e/vJMNjuj
Due to the PCB layout shown in the itead link this circuit uses a serial MCU to drive relays and key inputs.
You can see the 20-pin square chip in the upper right corner and you can follow the "relay" pcb lines.
There are a lot of "NC" connectors - NC usually says "not connected" but obviously they are.

So this is questionable with ESPEasy.
If it uses the serial MCU it might run into same problems as the Sonoff dual.
If some of the "NC" pins are connected to usual GPIO and used by the circuit it might work.

PS: PSF-B85 and PSB-04 seem to be different ...

PSB-04 uses a serial MCU as mentioned above and uses an ESP-8266.
Datasheet: https://www.itead.cc/wiki/PSB_Series_Sm ... tch_Module

PSF-B85 seems to be a ESP-8285 based equivalent to an ESP-12 module,
1MB built in Memory and other pinout and no additional MCU
Datasheet: https://www.itead.cc/wiki/File:Psf_03.jpg

So those 4ch with a PSF-B85 should work easily with ESPEasy, might be necessary to use a ESP-8285 compiled binary.
Regards
Shardan

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

Re: Sonoff 4CH with ESPEasy

#96 Post by Dylantje » 29 Sep 2017, 16:47

stofakiller wrote: 29 Sep 2017, 11:55 It worked :-)

Its a 8266 chip and works perfect as a Sonoff 4ch PRO module

Please a step by step?
Or link where i do the same thing....

My 4channel is online only i cannot use the channels...

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#97 Post by grovkillen » 29 Sep 2017, 17:04

Shardan wrote: 29 Sep 2017, 14:52
grovkillen wrote: 29 Sep 2017, 13:29
Shardan wrote: 29 Sep 2017, 13:11 Which device is that? It's not the 4ch switch showed above, isn't it?
It's the "Successful Case" explained here:
https://www.itead.cc/psb-04.html

A ton of itead based OEM modules are found here: http://s.click.aliexpress.com/e/vJMNjuj
Due to the PCB layout shown in the itead link this circuit uses a serial MCU to drive relays and key inputs.
You can see the 20-pin square chip in the upper right corner and you can follow the "relay" pcb lines.
There are a lot of "NC" connectors - NC usually says "not connected" but obviously they are.

So this is questionable with ESPEasy.
If it uses the serial MCU it might run into same problems as the Sonoff dual.
If some of the "NC" pins are connected to usual GPIO and used by the circuit it might work.

PS: PSF-B85 and PSB-04 seem to be different ...

PSB-04 uses a serial MCU as mentioned above and uses an ESP-8266.
Datasheet: https://www.itead.cc/wiki/PSB_Series_Sm ... tch_Module

PSF-B85 seems to be a ESP-8285 based equivalent to an ESP-12 module,
1MB built in Memory and other pinout and no additional MCU
Datasheet: https://www.itead.cc/wiki/File:Psf_03.jpg

So those 4ch with a PSF-B85 should work easily with ESPEasy, might be necessary to use a ESP-8285 compiled binary.
Thanks for looking into it Shard.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#98 Post by grovkillen » 29 Sep 2017, 18:07

Screen dump of AliExpress picture. Seems to be genuine ESP.

https://www.dropbox.com/s/yo9wk6ibx1ia3 ... 0.png?dl=0
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#99 Post by grovkillen » 03 Nov 2017, 17:27

stofakiller wrote: 21 Sep 2017, 15:07 Hi,

I have a 5-32v Sonoff/Itead 4ch, but i cant figure out how to flash it. I have flash many types of Sonoff's, i have Sonoff POW, normal 1ch Sonoffs and bulbs... I have triede both thrue my Arduino to flash it and also tried to erase it with ESP_Basic_Flasher... I always get cant open the port. Anyone triede or have any suggestions?
sonoff-4ch.jpg
You found how to flash it but haven't reported back about it. Me and a friend flashed this unit plus the smaller one, with on relay, today. Will try to write an official wiki page for it soon.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

sandeepkumar12
New user
Posts: 1
Joined: 22 Nov 2017, 06:27

Re: Sonoff 4CH with ESPEasy

#100 Post by sandeepkumar12 » 22 Nov 2017, 06:29

Nowadays
https://logmein.site wrote:gmail login
accounts have become popular among people around the World more than ever before.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#101 Post by grovkillen » 02 Dec 2017, 21:22

stofakiller wrote: 21 Sep 2017, 15:07 Hi,

I have a 5-32v Sonoff/Itead 4ch, but i cant figure out how to flash it. I have flash many types of Sonoff's, i have Sonoff POW, normal 1ch Sonoffs and bulbs... I have triede both thrue my Arduino to flash it and also tried to erase it with ESP_Basic_Flasher... I always get cant open the port. Anyone triede or have any suggestions?
sonoff-4ch.jpg
This unit is now "officially" supported by ESP Easy: https://www.letscontrolit.com/wiki/inde ... ff_DIY_4ch
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#102 Post by manjh » 12 Dec 2017, 16:22

Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#103 Post by grovkillen » 12 Dec 2017, 17:04

manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
Since Tasmota is supporting that device it should be possible to write a plugin for ESP Easy as well. If you do some research on the subject and bring all your findings and suggest a enhancement on GitHub someone might pick up the idea.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Sonoff 4CH with ESPEasy

#104 Post by Shardan » 12 Dec 2017, 20:10

manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
There's already a long thread about sonoff pow in the forum.
http://www.letscontrolit.com/forum/view ... POW#p20950
Regards
Shardan

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#105 Post by manjh » 12 Dec 2017, 20:46

Shardan wrote: 12 Dec 2017, 20:10
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
There's already a long thread about sonoff pow in the forum.
http://www.letscontrolit.com/forum/view ... POW#p20950
I noticed, and managed to read half way through it.
At some point the discussion drifted off towards liability and how people will try to electrocute themself. :twisted:
I was hoping to find a firm "yes" or "no" answer to the support question, or (if that can't be given) perhaps a careful "maybe in the near future"...

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#106 Post by manjh » 12 Dec 2017, 20:48

grovkillen wrote: 12 Dec 2017, 17:04
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
Since Tasmota is supporting that device it should be possible to write a plugin for ESP Easy as well. If you do some research on the subject and bring all your findings and suggest a enhancement on GitHub someone might pick up the idea.
Ah, yes... :oops:
Unfortunately I am more of a tester than a developer these days... I'm sure I would eventually even be able to write a plugin, but the learning curve would be a bit steep! :)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#107 Post by grovkillen » 12 Dec 2017, 21:30

manjh wrote: 12 Dec 2017, 20:48
grovkillen wrote: 12 Dec 2017, 17:04
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
Since Tasmota is supporting that device it should be possible to write a plugin for ESP Easy as well. If you do some research on the subject and bring all your findings and suggest a enhancement on GitHub someone might pick up the idea.
Ah, yes... :oops:
Unfortunately I am more of a tester than a developer these days... I'm sure I would eventually even be able to write a plugin, but the learning curve would be a bit steep! :)
But you can always do something, like finding places where to find more information etc. Links are valuable assets.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Sonoff 4CH with ESPEasy

#108 Post by papperone » 13 Dec 2017, 07:37

manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#109 Post by manjh » 13 Dec 2017, 08:45

papperone wrote: 13 Dec 2017, 07:37
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
:) :) :) you just made my day! :) :) :)
This information is probably somewhere in the seond half of that long thread, which I have not read yet. I also checked the Wiki, found a number of Sonoff products that are supported but did not see any reference to the pow.
Can I assume the plugin is in Github?

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Sonoff 4CH with ESPEasy

#110 Post by papperone » 13 Dec 2017, 17:34

manjh wrote: 13 Dec 2017, 08:45
papperone wrote: 13 Dec 2017, 07:37
manjh wrote: 12 Dec 2017, 16:22 Any chance of formal support for the Sonoff Pow? Looks like a very handy little device to help understand power consumption...
What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
:) :) :) you just made my day! :) :) :)
This information is probably somewhere in the seond half of that long thread, which I have not read yet. I also checked the Wiki, found a number of Sonoff products that are supported but did not see any reference to the pow.
Can I assume the plugin is in Github?
Yes, it's in the playground still but fully functional...
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#111 Post by manjh » 13 Dec 2017, 17:37

papperone wrote: 13 Dec 2017, 17:34
manjh wrote: 13 Dec 2017, 08:45
papperone wrote: 13 Dec 2017, 07:37

What do you mean? I already wrote a plugin to support POW current/voltage reading feature.
The relay and led can be activated with standard plugin, what else you need?
:) :) :) you just made my day! :) :) :)
This information is probably somewhere in the seond half of that long thread, which I have not read yet. I also checked the Wiki, found a number of Sonoff products that are supported but did not see any reference to the pow.
Can I assume the plugin is in Github?
Yes, it's in the playground still but fully functional...
Great. Now I will have to figure out how to get it from that "playground", and compile....
For the time being, I am using the Sonoff with their app. Works great, but not integrated with other devicecs via Domoticz.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#112 Post by nekely » 16 Jan 2018, 23:19

I have managed to operate the sonoff 4ch correctly, with ESP, what I do not get is that none of the physical buttons work.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#113 Post by manjh » 16 Jan 2018, 23:45

nekely wrote: 16 Jan 2018, 23:19 I have managed to operate the sonoff 4ch correctly, with ESP, what I do not get is that none of the physical buttons work.
You need to create rules for that.
Example:

Code: Select all

On TurnOn1 do
  gpio, 12, 1
endon
On TurnOff1 do
  gpio, 12, 0
endon
On TurnOn2 do
  gpio, 5, 1
endon
On TurnOff2 do
  gpio, 5, 0
endon
On TurnOn3 do
  gpio, 4, 1
endon
On TurnOff3 do
  gpio, 4, 0
endon
On TurnOn4 do
  gpio, 15, 1
endon
On TurnOff4 do
  gpio, 15, 0
endon

on Toggle1 do
  if [relais1#state]=1
    Event TurnOff1
  else
    Event TurnOn1
  endif
endon
on Toggle2 do
  if [relais2#state]=1
    Event TurnOff2
  else
    Event TurnOn2
  endif
endon
on Toggle3 do
  if [relais3#state]=1
    Event TurnOff3
  else
    Event TurnOn3
  endif
endon
on Toggle4 do
  if [relais4#state]=1
    Event TurnOff4
  else
    Event TurnOn4
  endif
endon

on button1#state do
  Event Toggle1
endon
on button2#state do
  Event Toggle2
endon
on button3#state do
  Event Toggle3
endon
on button4#state do
  Event Toggle4
endon

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#114 Post by nekely » 17 Jan 2018, 10:27

sorry ..., I had not restarted the sonoff. :?
now it works, but only the first time it turns on and off, then I press the button and it does not do anything

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#115 Post by manjh » 17 Jan 2018, 10:45

nekely wrote: 17 Jan 2018, 10:27 sorry ..., I had not restarted the sonoff. :?
now it works, but only the first time it turns on and off, then I press the button and it does not do anything
can you show the rules and device settings?

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#116 Post by nekely » 17 Jan 2018, 20:07

this is the rule

Code: Select all

On Channel1#Switch do
    if [Channel1#Switch]=1
        event,Channel1_On
    else
        event,Channel1_Off
    endif
endon
On Channel2#Switch do
    if [Channel2#Switch]=1
        event,Channel2_On
    else
        event,Channel2_Off
    endif
endon
On Channel3#Switch do
    if [Channel3#Switch]=1
        event,Channel3_On
    else
        event,Channel3_Off
    endif
endon
On Channel4#Switch do
    if [Channel4#Switch]=1
        event,Channel4_On
    else
        event,Channel4_Off
    endif
endon


on Channel1_On do
    gpio,12,1
    inputswitchstate 0,1
endon
on Channel1_Off do
    gpio,12,0
    inputswitchstate 0,0
endon

on Channel2_On do
    gpio,5,1
    inputswitchstate 9,1
endon
on Channel2_Off do
    gpio,5,0
    inputswitchstate 9,0
endon

on Channel3_On do
    gpio,4,1
    inputswitchstate 10,1
endon
on Channel3_Off do
    gpio,4,0
    inputswitchstate 10,0
endon

on Channel4_On do
    gpio,15,1
    inputswitchstate 14,1
endon
on Channel4_Off do
    gpio,15,0
    inputswitchstate 14,0
endon
Image
Image
Image

TD-er
Core team member
Posts: 8772
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4CH with ESPEasy

#117 Post by TD-er » 17 Jan 2018, 20:11

What version of ESPeasy?
I recently (last week) fixed an issue with the switch plugin.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#118 Post by nekely » 17 Jan 2018, 20:25

version 2_3_0

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4CH with ESPEasy

#119 Post by grovkillen » 17 Jan 2018, 20:56

nekely wrote: 17 Jan 2018, 20:25version 2_3_0
That is the core version. What ESP Easy version?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Sonoff 4CH with ESPEasy

#120 Post by manjh » 17 Jan 2018, 21:29

In the first piece of code, you're checking on the state of the switch. Should be the state of the gpio.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#121 Post by nekely » 17 Jan 2018, 21:50

I just put the last update today, I'll try it

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#122 Post by nekely » 17 Jan 2018, 22:07

nothing, with the new update they do not work either

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#123 Post by nekely » 20 Jan 2018, 13:27

manjh wrote: 17 Jan 2018, 21:29 In the first piece of code, you're checking on the state of the switch. Should be the state of the gpio.
I'm sorry I did not see this message, I try it

tplus
New user
Posts: 3
Joined: 21 Jan 2018, 21:00

Re: Sonoff 4CH with ESPEasy

#124 Post by tplus » 21 Jan 2018, 21:02

Is there an IO-mapping for the Sonoff 4CH PRO available?

Thanks for help...

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#125 Post by nekely » 23 Jan 2018, 13:13

in the end I got it, thanks

at first pressing the button would turn on, but turning it off at the time it was turned on again.
After several tests I got it to work changing "normal switch" to "push button active low"

these are the rules that you create

Code: Select all

on Boton1#Switch do
if [Boton1#Switch]=1
gpio,12,0
else
gpio,12,1
endif
endon

on Boton2#Switch do
if [Boton2#Switch]=1
gpio,5,0
else
gpio,5,1
endif
endon

on Boton3#Switch do
if [Boton3#Switch]=1
gpio,4,0
else
gpio,4,1
endif
endon

on Boton4#Switch do
if [Boton4#Switch]=1
gpio,15,0
else
gpio,15,1
endif
endon
now all switch works fine, I just need to try it with my veraedge

tplus
New user
Posts: 3
Joined: 21 Jan 2018, 21:00

Re: Sonoff 4CH with ESPEasy

#126 Post by tplus » 23 Jan 2018, 17:52

I tried to find the GPIO IO-mapping for the 4CH Pro using HTTP commands. At GPIO-6 relay one got on but I could not switch it off again. Tried also to switch on GPIO 4 and 5. Then I could not connect to the GUI any more and now the 4CH Pro is in a boot-loop:

Code: Select all

INIT : Booting version: v2.0-20180120
INIT : Cold Boot
FS   : Mounting...
FS   : Mount successful, used 75802 bytes of 113201
INIT : Free RAM:26000
INIT : I2C
INIT : SPI not enabled
WIFI : AP Mode disabled
WIFI : AP Mode ssid will be ESP_water_0 with address 192.168.4.1
WIFI : Connecting XXXX attempt #1
WIFI : Connected! IP: 192.168.10.35 (ESP_water_0)

 ets Jan  8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮U


INIT : Booting version: v2.0-20180120
INIT : Warm boot #1
FS   : Mounting...
FS   : Mount successful, used 75802 bytes of 113201
INIT : Free RAM:26000
INIT : I2C
INIT : SPI not enabled
WIFI : AP Mode disabled
WIFI : AP Mode ssid will be ESP_water_0 with address 192.168.4.1
WIFI : Connecting XXXX attempt #1
WIFI : Connected! IP: 192.168.10.35 (ESP_water_0)

 ets Jan  8 2013,rst cause:4, boot mode:(3,0)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
⸮U
When I change the onboard "Work Mode Switch" from "Interlock" to "Self-locking/Inching" it's still in a loop but the boot mode changes to (3,2). Also the top 3 LED are on.

Installed software v2.0-20180123, no change.

What to do? Is there a "GPIO of death"?

Thanks for some help.

nekely
New user
Posts: 9
Joined: 16 Jan 2018, 23:17

Re: Sonoff 4CH with ESPEasy

#127 Post by nekely » 24 Jan 2018, 20:10

nekely wrote: 23 Jan 2018, 13:13 now all switch works fine, I just need to try it with my veraedge
Works fine with my veraedge, send de command and status correctly modifing some the rules to send htpp commands

tplus
New user
Posts: 3
Joined: 21 Jan 2018, 21:00

Re: Sonoff 4CH with ESPEasy

#128 Post by tplus » 26 Jan 2018, 17:11

Sonoff 4CH Pro:

GPIO mapping is the same. All K5 switches should be set to "on", the S6 switch to 1. Then it works like the standard one.

radebebek
New user
Posts: 5
Joined: 05 Feb 2018, 11:06

Re: Sonoff 4CH with ESPEasy

#129 Post by radebebek » 05 Feb 2018, 11:10

...
Last edited by radebebek on 05 Feb 2018, 11:14, edited 2 times in total.

radebebek
New user
Posts: 5
Joined: 05 Feb 2018, 11:06

Re: Sonoff 4CH with ESPEasy

#130 Post by radebebek » 05 Feb 2018, 11:13

Hello All,

I have this scheme wiring: http://prntscr.com/i0qrfb

I used homebridge plugin and iphone app HOME and I have problem about inform state.

Example:

1. State Lights on HOME app is OFF.
2. Turn on Lights with HOME app on R1 relay, snd Sonoff PRO switch reley and Lights is ON. On app HOME change state to ON.
3. When I pressing physical key "WALL SWITHC" Disconnect Electric Cricuit and turn off Light.
State continue ON on HomeAPP.

How to inform app that state is change?
Is there firmware has this possibility?
Rade

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests