Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New functionality adding request: invert led state #2075

Closed
Vikingfr opened this issue Mar 3, 2018 · 8 comments
Closed

New functionality adding request: invert led state #2075

Vikingfr opened this issue Mar 3, 2018 · 8 comments
Labels
help needed Action - Asking for help from the community stale Action - Issue left behind - Used by the BOT to call for attention

Comments

@Vikingfr
Copy link

Vikingfr commented Mar 3, 2018

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)

@Jason2866
Copy link
Collaborator

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

@Vikingfr
Copy link
Author

Vikingfr commented Mar 3, 2018

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

@Jason2866
Copy link
Collaborator

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...

@arendst arendst added the help needed Action - Asking for help from the community label Mar 9, 2018
@geek65535
Copy link

@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.

@Jason2866
Copy link
Collaborator

Jason2866 commented Mar 10, 2018

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.

@stale
Copy link

stale bot commented Jun 6, 2018

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.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Jun 6, 2018
@stale
Copy link

stale bot commented Jun 21, 2018

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.

@stale stale bot closed this as completed Jun 21, 2018
@OneHoopyFrood
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help needed Action - Asking for help from the community stale Action - Issue left behind - Used by the BOT to call for attention
Projects
None yet
Development

No branches or pull requests

5 participants