Comments (7)
I use many of them in the garden, therefore, I have the same use-case. Currently, I send through MQTT a retained message on cmd/device/deepsleep 0. In most cases, the device with the next wake-up will read the values and stay online. In some cases it takes a second wakeup. Important is to store the message in the MQTT stack. The button you can easily solder between RST and 3.3V. This cause a wakeup, whenever you close the button. Be sure that there are no other messages stored in cmd/device because the pubsubclient can only execute ONE stored message on restore.
from sonoff-tasmota.
Hi,
Haw to do it as retained ?
" send through MQTT a retained message on cmd/device/deepsleep 0"
is it π
mosquitto_pub -h localhost -p 1883 -r -u xxxxxxx -P xxxxxx -t cmnd/wemeos/deepsleep -m 0
or
mosquitto_pub -h localhost -p 1883 -r -u xxxxxx-P xxxxxxx -t cmd/wemeos/deepsleep -m 0
it woke up, but I do not know what was corect :-)
What is it ?
cmnd/wemeos/POWER (null)
because I do not set relay ?
PS.
Do you know haw to do button get worked without relay assigment ?
from sonoff-tasmota.
The first one is the correct one because in the second one there is a space missing between password and user and it could be that default is cmnd and not cmd. Retaining a message requires -r. This is correct. IF you like it more convenient I would suggest using MQTT spy. https://kamilfb.github.io/mqtt-spy/
the POWER message could be from the device itself. It has some nasty behavior to post something in the cmnd. I don't like it, but this is the way arendst has programmed it. Having a NULL here is a side-effect when there is no RELAY. You can assign a button and it works. The multitouch gestures on the button are working. You just get no MQTT message on pressing the button e.g. 3 times. This is not implemented. You can define "switchtopic switch", then you get an MQTT message. the Format is fixed
from sonoff-tasmota.
Hi,
What do you mean "You can assign a button and it works. The multitouch gestures on the button are working."
I do not catch that.
I do not see button on www and additionaly
19:27:04 CMD: switchtopic 1
19:27:04 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"wemeos"}
19:27:07 MQT: cmnd/wemeos/POWER = ON
19:27:07 MQT: stat/wemeos/command= {"command":"unknown"}
19:27:07 MQT: cmnd/wemeos/POWER = OFF
next
19:29:12 CMD: Switchtopic 0
19:29:12 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":""}
19:29:17 MQT: stat/wemeos/POWER = {"POWER":"ON"}
19:29:17 MQT: stat/wemeos/POWER = ON
19:29:17 MQT: stat/wemeos/POWER = {"POWER":"OFF"}
19:29:17 MQT: stat/wemeos/POWER = OFF
next
19:30:00 CMD: switchtopic1 switch
19:30:00 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"switch"}
19:30:04 MQT: cmnd/switch/POWER = ON
19:30:04 MQT: cmnd/switch/POWER = OFF
19:30:05 MQT: cmnd/switch/POWER = ON
19:30:05 MQT: cmnd/switch/POWER = OFF
19:30:06 MQT: cmnd/switch/POWER = ON
LED does not reacts
next
19:31:07 CMD: switchtopic1 1
19:31:07 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"wemeos"}
19:31:17 MQT: cmnd/wemeos/POWER = ON
19:31:17 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
19:31:18 MQT: cmnd/wemeos/POWER = OFF
19:31:18 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
LED react
next
19:33:53 CMD: Switchiopic
19:33:53 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
next
19:35:42 CMD: SwitchTopic wemeos
19:35:42 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"wemeos"}
19:35:47 MQT: cmnd/wemeos/POWER = ON
19:35:47 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
19:35:47 MQT: cmnd/wemeos/POWER = OFF
19:35:47 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
LED react
next
19:37:09 CMD: SwitchTopic 0
19:37:09 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":""}
19:37:16 MQT: stat/wemeos/POWER = {"POWER":"ON"}
19:37:16 MQT: stat/wemeos/POWER = ON
19:37:16 MQT: stat/wemeos/POWER = {"POWER":"OFF"}
19:37:16 MQT: stat/wemeos/POWER = OFF
19:37:16 MQT: stat/wemeos/POWER = {"POWER":"ON"}
19:37:16 MQT: stat/wemeos/POWER = ON
19:37:16 MQT: stat/wemeos/POWER = {"POWER":"OFF"}
19:37:16 MQT: stat/wemeos/POWER = OFF
LED react
next
19:37:55 CMD: SwitchTopic 1
19:37:55 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"wemeos"}
19:38:04 MQT: cmnd/wemeos/POWER = ON
19:38:05 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
19:38:05 MQT: cmnd/wemeos/POWER = OFF
19:38:05 MQT: stat/wemeos/KOMENDA = {"Komenda":"Nieznany"}
LED react
next
19:40:16 CMD: switchtopic 0
19:40:16 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":""}
19:40:28 CMD: switchtopic1 switch1
19:40:28 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"switch1"}
19:40:31 MQT: cmnd/switch1/POWER = ON
19:40:31 MQT: cmnd/switch1/POWER = OFF
19:40:32 MQT: cmnd/switch1/POWER = ON
19:40:33 MQT: cmnd/switch1/POWER = OFF
LED not react
For all no button commands i.e. restart , AP etc.
from sonoff-tasmota.
I got creasy, I defined 2 switches and
19:56:09 CMD: switchtopic switch
19:56:09 MQT: stat/wemeos/SWITCHTOPIC = {"SwitchTopic":"switch"}
19:56:22 MQT: cmnd/switch/POWER = ON
19:56:23 MQT: cmnd/switch/POWER = OFF
19:56:26 MQT: cmnd/switch/POWER = ON
19:56:27 MQT: cmnd/switch/POWER = OFF
19:56:36 MQT: cmnd/switch/POWER = TOGGLE
19:56:36 MQT: cmnd/switch/POWER = TOGGLE
I do not get such efect:
haw to set 2 Switchttopics or POWER1 and POWER2
I can not find Maxdevices variable to set to 1
"
As you are running WITHOUT a relay it is not a sonoff and therefore anything could happen but apparently I seem to have provided some nice features anyhow. It's intended behavior:
A switch was intended to control the corresponding physical relay in a sonoff OR send a MQTT message
Without relays the software assumes no real devices are present (Maxdevice = 0) but a single virtual relay is present and configures itself for it.
Using any switch in that situation WITHOUT naming a switchtopic will control the single virtual relay and responds with what you see as stat/upstairs/POWER ON. That's POWER without a number as it assumes there is only one relay present.
Setting switchtopic to anything but 0 starts using another part of the code and allows for sending MQTT messages like cmnd/switchtopic/POWER1 ON where the number after POWER is the switch number.
Your latest entry is also expected as you are using the same topic for Topic and switchtopic which will start limbo as you noticed.
"
from sonoff-tasmota.
Hi,
Success i have 100 uA during sleep with the chip CP2104 ther is 1.2 mA but I found solution. But for the switches there is black magic for me - I do not know haw to set POWER1 POWER2 "switchTopic1" "SwitchTopic2" etc. And additionaly 2 dummy devicec RELAY0 and RELAY1 for operating for 2 topicks.
The retain message works
mosquitto_pub -h localhost -p 1883 -r -u xxxxxxx -P xxxxxx -t cmnd/wemeos/deepsleep -m 0
but after that you need to set clear retain
mosquitto_pub -h localhost -p 1883 -r -u xxxxxxx -P xxxxxx -t cmnd/wemeos/deepsleep -n
because of each time module goes to that mode even when you set it on console side.
from sonoff-tasmota.
There is now an option like on ESPeasy to use a pin to avoid deepsleep. A normal switch would do the deal. Please see more on the wiki. A quite smart solution copied from there.
from sonoff-tasmota.
Related Issues (20)
- SetOption80 1 HangUp the Device HOT 13
- CanΒ΄t connect to WIFI after upload your Firmware HOT 2
- SHUTTER50PERCENT not work HOT 7
- Erratic Behaviour when Slow Blinds - includes fix HOT 1
- Dim the lights in the switch? HOT 6
- Shutter dead time support HOT 11
- Vcc in state HOT 3
- Alexa Dimming doesnt work HOT 4
- PCF8574 on master HOT 2
- PCF8574: ports on at startup HOT 9
- MQTT Report during movement HOT 1
- DeepSleep consumption HOT 1
- MQT: TLS connection error: 0 HOT 4
- Calibration 2nd shutter HOT 1
- Shutter with LC-TECH X2 in mode 1 allows changing direction without power removal HOT 5
- MQT: TLS connection error: 0 HOT 1
- Mq sensor
- Sonoff touch TX T3 Us
- upgrading from Sonoff-Tasmota 6.5.0.11 stb-1.5 by Theo Arends HOT 7
- Shutter - inverse mode - slider not correct HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonoff-tasmota.