Switch2 status and restart

26 views
Skip to first unread message

Max

unread,
Aug 9, 2020, 2:37:43 AM8/9/20
to TasmotaUsers
Hello to everyone.
I'm new on tasmota, I love it... but as newby I start to have some problem.

I've flashed a Wemos D1R2 with Tasmosta 8.4.0. It works well but I have some issus that I'm not able to solve.

I use for my first project a water level sensor connect to the GPI04 (D2).
I can see very well all the status change on console and also on my MQTT Server.

But...
1) When I check the status with the command "Status 8" the answer is the opposite of the configuration, it answer like
     switch1 and not like Switch2, so if the circuit is close I receive a OFF on the switch but ON on the status and the opposite
     when the level sensor is open
2) When the WeMos restarts (after loosing power) it doesn't send the last status in  "stat/BilgeSensor/RESULT" I have to wait
     that the sensor has a change of status, that's why I would like to send to the Wemos a "Status 8" and check the current status.

I already tried to found this solution here, so I hope this is not another duplicate post.

Thanks
Max 

Philip Knowles

unread,
Aug 9, 2020, 4:35:19 AM8/9/20
to Max, TasmotaUsers

ESP8266 GPIO inputs generally go LOW (from Vcc to 0v) for ON. If your device has a NC contact you need to connect a 4k7 resistor from Vcc to the GPIO and connect your contact from the GPIO to Vcc.  Alternatively you can use a SwitchXi input but you are better to use the pullup resistor.

To get an update on restart you can use an on boot rule.

on system#boot do status 8 end

 

Regards

 

Phil K

 

 

 

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/d86ddce9-203b-42fa-b3ae-4690000ab14co%40googlegroups.com.

 

Ale e Max Terragni - Y2K

unread,
Aug 9, 2020, 4:39:53 AM8/9/20
to Philip Knowles, TasmotaUsers
Hi Philip,
Thanks for you answer. 
I confirm that I do have the resistor and I already check the status 8. 
I have other problem. 
The answer from Status 8 is wrong is the opposite of my real status. 

Max

Philip Knowles

unread,
Aug 9, 2020, 5:36:00 AM8/9/20
to Ale e Max Terragni - Y2K, TasmotaUsers
You need to use the SwiychXi then which will invert the input

Regards

Phil K

Sent from Outlook Mobile


From: Ale e Max Terragni - Y2K <y2k...@gmail.com>
Sent: Sunday, August 9, 2020 9:39:36 AM
To: Philip Knowles <knowles...@gmail.com>
Cc: TasmotaUsers <sonof...@googlegroups.com>
Subject: Re: Switch2 status and restart
 

Ale e Max Terragni - Y2K

unread,
Aug 9, 2020, 5:42:01 AM8/9/20
to Philip Knowles, TasmotaUsers
Ok,
I have no idea what it is but I will Google it. 
Thanks 
Max

Philip Knowles

unread,
Aug 9, 2020, 6:23:49 AM8/9/20
to Ale e Max Terragni - Y2K, TasmotaUsers

My mistake, forgot that there isn’t an inverted switch. You need to connect the resistor between the GPIO and 0V and the switch between Vcc and the GPIO to get the functionality correct.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Ale e Max Terragni - Y2K
Sent: 09 August 2020 10:41
To: Philip Knowles
Cc: TasmotaUsers
Subject: Re: Switch2 status and restart

 

Ok,

I have no idea what it is but I will Google it. 

Thanks 

Max

Il dom 9 ago 2020, 21:35 Philip Knowles <knowles...@gmail.com> ha scritto:

You need to use the SwiychXi then which will invert the input

Regards

Phil K

Sent from Outlook Mobile

 

Max

unread,
Aug 9, 2020, 6:47:00 AM8/9/20
to TasmotaUsers
Hi Phil,
the connections are already as you describe.

Immagine.jpg


Here in the picture and in attach the console logging.
As you can see the switch already works as inverted.
No problem at all, the problem is only in the status 8 that is not inverted.

Max
Immagine.jpg

Philip Knowles

unread,
Aug 9, 2020, 6:50:42 AM8/9/20
to Max, TasmotaUsers

Can you take a screenshot of the configuration page? I suspect I know what the issue is.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Max
Sent: 09 August 2020 11:47
To: TasmotaUsers
Subject: Re: Switch2 status and restart

 

Hi Phil,

the connections are already as you describe.

 

 

Here in the picture and in attach the console logging.

As you can see the switch already works as inverted.

No problem at all, the problem is only in the status 8 that is not inverted.

 

Max

 

 

Il giorno domenica 9 agosto 2020 22:23:49 UTC+12, Philip Knowles ha scritto:

My mistake, forgot that there isn’t an inverted switch. You need to connect the resistor between the GPIO and 0V and the switch between Vcc and the GPIO to get the functionality correct.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

--

You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

Max

unread,
Aug 9, 2020, 6:56:08 AM8/9/20
to TasmotaUsers
Hi Phil,
you mean this?

Immagine.jpg

Max
Reply all
Reply to author
Forward
0 new messages