ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware

Define high? The temperature recorded for 5 amps. That’s 1kw in Europe only went up a few degrees. Even at ten amps it was well within operating range.
Driving some lights will at most 1 amp.

Now that their certificate is gone 404 is odd. Not because it is not safe but because Itead is generally very good at keeping this up-to-date. I will message them when I get home and I am sure that this will be corrected.

Sorry- I thought he was talking about the new Shelly devices.

The CE certificate for the sonoff if up:

https://www.itead.cc/sonoff-wifi-wireless-switch.html

Hi Guys,

Apologies if this been asked already.
I’ve got sonoff basic with latest tastmota as of today. Openhab with sonoff basic with tasmota is working fine, but I don’t want to sonoff to be always on. so the way I wired the light switch is the light switch will power the sonoff then power on the lights. so I want to when I turn on the switch I want the lights to be on

I’ve tried this from the console “cmnd/sonoff01/PowerOnState 1”

the problem I have is if in openhab the last status of the switch is OFF, then I turn on the switch light, the light will stay on for about 3-5 sec then it will turn off. if the status of the light switch in openhab is ON then I turn on the light switch the light will stay on.

It seems the status is depended on the status of the switch in openhab.

How do I solve this?

Thanks in advance

I guess my first question is why you are controlling the Sonoff power with the switch rather than leaving it always on? If it’s an energy consumption concern (https://github.com/arendst/Sonoff-Tasmota/wiki/Energy-Saving), perhaps you want to consider the TASMOTA SLEEP option? I set my devices to SLEEP 250 which is a 75% duty cycle (off 25% of the time). These devices can be set to consume less than half a Watt/day with the SLEEP setting enabled. If it’s a safety concern, that’s probably unwarranted.

PowerOnState 1 tells TASMOTA to turn on the relay when the device boots. Perhaps you want a different setting? See here for the options - https://github.com/arendst/Sonoff-Tasmota/wiki/PowerOnState-Configuration

Also, you may be dealing with some latent MQTT retain issues. Review this tutorial to get a better understanding of retain issues - https://www.youtube.com/watch?v=31IyfM1gygo

Regards.

Mike

1 Like

thanks meingraham.

I just want it off when I want it to be off :slight_smile:
looks like a MQTT retain issue

Thanks again

Hey Guys I just made this pedal Wall Switch with a sonoff basic running tasmota, I just configured my MQTT server and its running along with OH2 flawlessly, but i got a problem, when I switch “On” state on my basic UI it turns ON normally, but if i switch OFF the pedal of the Switch I just made, it doesn’t report the state OFF on my Basic UI, so the state its always ON on Open Hab, when the Switch and the light are really OFF. Is it a problem with the state topic?? how can I connect or refresh the state on my basic UI??

heres my MQTT setup

Switch Switch_Entrada “Switch Entrada” {mqtt=">[mosquitto:cmnd/sonoff1/power:command:on:1],>[mosquitto:cmnd/sonoff1/power:command:off:0],<[mosquitto:cmnd/sonoff1/power:state:default]"}

thanks for the help guys

New Version released 6.3.0 here is the

Changelog

Version 6.3.0 20181030

  • Change web Configure Module GPIO drop down list order for better readability
  • Change status JSON message providing more switch and retain information
  • Change xsns_17_senseair.ino to use TasmotaModbus library
  • Change MCP230xx driver
  • Change PubSubClient Mqtt library to non-blocking EspEasy version
  • Change energy monitoring using energy sensor driver modules
  • Change Webserver page handler for easier extension (thx to Adrian Scillato)
  • Change pinmode for no-pullup defined switches to pullup when configured as switchmode PUSHBUTTON (=3 and up) (#3896)
  • Change default OTA Url to http://thehackbox.org/tasmota/release/sonoff.bin (#4170)
  • Remove support for MQTT Client esp-mqtt-arduino by #define MQTT_LIBRARY_TYPE MQTT_ESPMQTTARDUINO
  • Remove commands PowerCal, VoltageCal and CurrentCal as more functionality is provided by commands PowerSet, VoltageSet and CurrentSet
  • Remove restart after ntpserver change and force NTP re-sync (#3890)
  • Fix showing Period Power in energy threshold messages
  • Fix header file execution order by renaming user_config.h to my_user_config.h
  • Fix some TSL2561 driver issues (#3681)
  • Fix KNX PA exception. Regression from 6.2.1 buffer overflow caused by subStr() (#3700, #3710)
  • Fix setting and getting color temperature for Philips Hue emulation (#3733)
  • Fix ButtonRetain to not use default topic for clearing retain messages (#3737)
  • Fix syslog when emulation is selected (#2109, #3784)
  • Fix rule trigger POWER1#STATE execution after restart and SetOption0 is 0 (#3856)
  • Fix Home Assistant forced light discovery (#3908)
  • Fix invalid configuration restores and decode_config.py crc error when savedata = 0 (#3918)
  • Fix timer offset -00:00 causing 12:00 hour offset (#3923)
  • Fix I2CScan invalid JSON error message (#3925)
  • Fix exception when wrong Domoticz JSON message is received (#3963)
  • Fix Sonoff Bridge RfRaw receive (#4080, #4085)
  • Fix possible wifi connection error (#4044, #4083)
  • Fix invalid JSON floating point result from nan (Not a Number) and inf (Infinity) into null (#4147)
  • Fix rule mqtt#connected trigger when mqtt is disabled (#4149)
  • Add support for LCD, Matrix, TFT and Oled displays
  • Add support for Neo Coolcam Wifi Smart Power Plug
  • Add support for Michael Haustein ESP Switch
  • Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
  • Add support for Neo Coolcam Wifi Smart Power Plug
  • Add support for Michael Haustein ESP Switch
  • Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
  • Add support for DS3231 Real Time Clock
  • Add support for HX711 Load Cell with optional web GUI scale interface to demonstrate easy GUI plug-in
  • Add support for serial 8N2 communication to TasmotaModbus and TasmotaSerial libraries
  • Add support for RF transceiving using library RcSwitch (#2702)
  • Add support for Shelly 1 and Shelly 2 (#2789)
  • Add support for La Crosse TX20 Anemometer (#2654, #3146)
  • Add support for MP3 player using DFRobot RB-DFR-562 (#3723)
  • Add Support for Xiaomi-Philips Bulbs (#3787)
  • Add support for PCA9685 12bit 16pin hardware PWM driver (#3866)
  • Add support for EXS Relay V5.0 (#3810)
  • Add support for OBI Power Socket (#1988, #3944)
  • Add support for Teckin Power Socket with Energy Monitoring (#3950)
  • Add support for Pzem-003/017 DC Energy monitoring module (#3694)
  • Add support for Pzem-014/016 AC Energy monitoring module (#3694)
  • Add support for CSL Aplic WDP 303075 Power Socket with Energy Monitoring (#3991, #3996)
  • Add support for Tuya Dimmer (#469, #4075)
  • Add command Display to show all settings at once
  • Add command SerialSend5 to send raw serial data like “A5074100545293”
  • Add command WebRefresh 1000…10000 to control web page refresh in milliseconds. Default is 2345
  • Add command WeightRes 0…3 to control display of decimals for kilogram
  • Add command RGBWWTable to support color calibration (#3933)
  • Add command Reset 4 (reset to defaults but keep wifi params) and Reset 5 (as reset 4 and also erase flash) (#4061)
  • Add command SetOption35 0…255 (seconds) to delay mDNS initialization to control possible Wifi connect problems
  • Add command SetOption52 0/1 to control display of optional time offset from UTC in JSON messages (#3629, #3711)
  • Add command SetOption53 0/1 to toggle gui display of Hostname and IP address (#1006, #2091)
  • Add authentication to HTTP web pages
  • Add decimals as input to commands PowerSet, VoltageSet and CurrentSet
  • Add tools/decode-config.py by Norbert Richter to decode configuration data. See file for information
  • Add define USE_DISPLAYS for selecting image sonoff-display
  • Add define USE_BASIC for selecting image sonoff-basic without most sensors
  • Add auto reload of main web page to some web restarts
  • Add TasmotaModbus library as very basic modbus wrapper for TasmotaSerial
  • Add more API callbacks and document API.md
  • Add Apparent Power and Reactive Power to Energy Monitoring devices (#251)
  • Add token %hostname% to command FullTopic (#3018)
  • Add Wifi channel number to state message (#3664)
  • Add user configurable GPIO02 and GPIO03 on H801 devices (#3692)
  • Add toggle function RGBW lights (#3695, #3697)
  • Add network information to display start screen (#3704)
  • Add sleep to Nova Fitness SDS01X sensor (#2841, #3724, #3749)
  • Add Analog input AD0 enabled to sonoff-sensors.bin (#3756, #3757)
  • Add power value below 5W to Sonoff Pow R2 and S31 (#3745)
  • Add RF Receiver control to module MagicHome to be used on Arilux LC10 (#3792)
  • Add userid/password option to decode-status.py (#3796)
  • Add delay after restart before processing rule sensor data (#3811)
  • Add force_update to Home Assistant discovery (#3873)
  • Add rule triggers SWITCH1#BOOT and POWER1#BOOT (#3904, #3910)
  • Add Hebrew language file (#3960)
  • Add TotalStartTime to Energy JSON message (#3971)
  • Add whitespace removal from RfRaw and SerialSend5 (#4020)
  • Add support for two BMP/BME sensors (#4195)
1 Like

Look on tasmota wiki for switchmode

I got the Switchmode1 4 is the one for fisic switches. When the sonoff its OFF everything its OFF, When I push the botton the relay on the sonoff goes ON and MQTT sends the “ON” stat. Am i missing something??? still can get in my basic UI the switch toggle together with the MQTT

GOT IT!!!

the STATE suscribe topic was wrong in my original Items config.

SOLVED like this

Switch Luz_TV “Luz TV” [ “Lighting” ] {mqtt=">[mosquitto:cmnd/sonoff1/power:command:*:default],<[mosquitto:stat/sonoff1/POWER:state:default]"}

for people having the same problem BEWARE from the “power” topic on the “cmnd” line, and the “POWER” topic on the “stat” line.

Cheers!!

tasmota doesn’t care about capitalisation for incoming topic, Your could send Power, power or POWER, it’s all the same.
BUT tasmota publishers power stat in capitals and openHAB is case sensitive for incoming topics.

For consistency sake ALL my switches use POWER in capitals, both for cmnd and stat topics.

2 Likes

Has anyone tried their sonoff tasmoto devices with the new MQTT binding?

Yes Sir, havw three Basics and on Pow with the mqtt binding working. The ist one pifall. If you define a switch for avaiablility based on the LWT message you need a command of anny kind to. Otherweise the thing will stay in initialisation state.

Changing this in my setup every thing works flawlessly. Kudos to @David_Graeff

I’m struggling with the first attempts to change from the MQTT1 to the new MQTT binding.
I got the connection to the broker but… structuring channels and items :face_with_monocle:
Could you show us some kind of sample configuration for a Sonoff switch?

This was solved on another thread already

2 Likes

@ThomDietrich
Maybe this link above could go into your reserved post #2

Thank’s!
found there a blog entry from David Graf :+1:
secret revealed…
MQTT Arrives in the Modern openHAB 2.x Architecture

Hello everyone
I went crazy all afternoon behind this problem, I can’t see the ON OFF payload on OH2, I use Mosquitto as a broker.
The card is a NODEMCU with Tasmota 11, I need it to read the status of an MQ2 sensor (digitally) to detect any gas leaks.
The sensor is connected to the GPIO2 as Switch1. With MQTT.fx I read the payload ON / OFF … then the broker reads the payload. But not OH.
ITEMS:

Switch sensore_caldaia        "sensore caldaia "                        <sensore_fumo>	 (sensori)    		    {mqtt="<[mosquitto:stat/locale_caldaia/SWITCH1:state:default]"  }```

sitemap:
Switch item=sensore_caldaia	

rule:
rule "sensore gas caldaia"

when
Item sensore_caldaia changed  
then
   if (sensore_caldaia.state == ON ){
    Thread::sleep(3000)
	if  (sensore_caldaia.state == ON) {
	postUpdate (ON)
	playSound("RedAlert .mp3")
	Thread::sleep(1000)
	playSound("attenzione_fuga_di_gas_nel_locale_caldaia.mp3")	
	sendTelegram("bot1", "ALLARME LOCALE CALDAIA!")
	
	     }
   }   
  if (sensore_caldaia.state == CLOSED && timer === null) {
    timer = createTimer(now.plusMinutes(5)) [|     
	timer = null
	]
	postUpdate (OFF)
  } 
end

I ask you for help, thank you, sorry for the mistakes but I'm pretty tired

This is an rather old thread, you should have started a new onle for your problem!

Which MQTT binding are you using? The itme uses the Version 1 Syntax, confirm you are using this binding!

The syntax in your rule has several probems, solve those after the initial problem is cleared!