Tasmota: New functionality adding request: invert led state

Created on 3 Mar 2018  路  8Comments  路  Source: arendst/Tasmota

Hi,
I'm using sonoff+tasmota to control my heater using his control wire (we call it 'fil pilote' in France). If relay is off, heater is working, if relay is on, heater stop.
Could you add option to invert led state, so LED is on if relay is off. This way, I know heater is ON when LED is visible

(sorry if bad english, I'm french)

help needed stale

Most helpful comment

It is there as a software option! you have to change it in the web console of the module as i described.
Read the wiki...

All 8 comments

It is already implemented. Use generic module. Here you can define led inverted -> Led1i

I don't understand how to do that with a sonoff dual. It would be easier to have an software option

It is there as a software option! you have to change it in the web console of the module as i described.
Read the wiki...

@Jason2866 Rather than being snippy at someone who doesn't speak English as his first language, perhaps you could be a little more helpful and point to the part of the wiki that explains how to invert the output of the LED. I'd do it, but I can't find the information myself.

Sorry, if i was unpolite. English isnt my mother language too....

If Tasmota is running on the module you can select which type of module to use.
Dont select here the dual. Select modul generic.
Take a look in the source code sonoff_template.h. Here you find the definitions for the GPIO functions for the modules. Use the definition Sonoff dual as start for your settings in the Web Console for the settings
Module Generic. If switching works use instead as Example for Led1 Led1i. This will invert the Led function
Here the snipplet from sonoff_template.h:
{ "Sonoff Dual", // Sonoff Dual (ESP8266)
0,
GPIO_TXD, // GPIO01 Relay control
0,
GPIO_RXD, // GPIO03 Relay control
GPIO_USER, // GPIO04 Optional sensor
0,
0, 0, 0, 0, 0, 0, // Flash connection
0,
GPIO_LED1_INV, // GPIO13 Blue Led (0 = On, 1 = Off)
GPIO_USER, // GPIO14 Optional sensor
0, 0, 0
},
You have to use this settings. For your use change the Led on GPIO14 to LED1.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

If anyone else finds this like I did, and all you want to do is flip the LED on state, the answer is templating.

Steps to configure in this manner:

  1. Go to configuration -> Configure Template
  2. Give it a name (defaults to Generic)
  3. Set Based On to Sonoff Basic (this is what I'm using, if you're not then you'll need to adapt accordingly)
  4. Set GPIO13 to Led1 (defaults to Led1i)
  5. Save -> Return to main menu after restart
  6. Go to configuration -> Configure Module
  7. Set module type to your template name from step 2
  8. Save

The LED should now be on when the relay is off, and vice versa.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Joeyhza picture Joeyhza  路  3Comments

TylerDurden23 picture TylerDurden23  路  3Comments

JoergZ2 picture JoergZ2  路  3Comments

belidzs picture belidzs  路  3Comments

esp32x picture esp32x  路  3Comments