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

Switch1: FULLTOPIC is ignored for WS2812 POWER and STATUS #4190

Closed
4 tasks done
makefu opened this issue Oct 28, 2018 · 4 comments
Closed
4 tasks done

Switch1: FULLTOPIC is ignored for WS2812 POWER and STATUS #4190

makefu opened this issue Oct 28, 2018 · 4 comments
Labels
troubleshooting Type - Troubleshooting

Comments

@makefu
Copy link

makefu commented Oct 28, 2018

Solution
topic and mqttclient were set to the same name which resulted in tasmota using the fallback topic instead of the main.

Describe the bug
When using the ws2812 module, configuring FULLTOPIC does not affect how the Result is published back to the message queue.

What i try to achieve is:

  1. the esp detects motion
  2. it turns on the leds (fading)
  3. it sends this motion detection to the message queue
  4. after no motion is detected anymore it turns off the leds
  5. it sends a message to the message queue that the motion stopped.

This is the trace of mosquitto_sub:

server: /ham/flurlicht/cmnd/POWER OFF # i turn the leds off
tasmota: stat/flurlicht/RESULT {"POWER":"OFF"}
tasmota: stat/flurlicht/POWER OFF
server: /ham/flurlicht/cmnd/Color2 36eaff # i set the new color
tasmota: stat/flurlicht/RESULT {"POWER":"ON","Dimmer":57,"Color":"1E8591","HSBColor":"186,79,57","Channel":[12,52,57]} # result is the leds being turned on

My guess is that this is related to the SwitchTopic command which i use to see changes of the switch.

  • Searched the problem in issues and in the wiki
  • Hardware used : Sonoff S20, ws2812 and a PIR motion detection sensor
  • Development/Compiler/Upload tools used : esptool.py v2.5.0
  • Provide the output of commandstatus 0 :
09:08:25 MQT: /ham/flurlicht/stat/STATUS = {"Status":{"Module":18,"FriendlyName":["flurlicht"],"Topic":"flurlicht","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":0,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.bin","RestartReason":"External System","Uptime":"3T12:21:05","StartupUTC":"2018-10-24T19:47:20","Sleep":0,"BootCount":13,"SaveCount":1665,"SaveAddress":"FB000"}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS2 = {"StatusFWR":{"Version":"6.2.1","BuildDateTime":"2018-09-09T16:50:26","Boot":31,"Core":"2_3_0","SDK":"1.5.3(aec24ac9)"}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["adblock",""],"TelePeriod":300,"SetOption":["00008009","55818000","00000000"]}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS4 = {"StatusMEM":{"ProgramSize":471,"Free":532,"Heap":13,"ProgramFlashSize":4096,"FlashSize":4096,"FlashMode":3,"Features":["00000809","0FDAE794","000003A0","23B617CE","00000000"]}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS5 = {"StatusNET":{"Hostname":"flurlicht-6591","IPAddress":"192.168.1.23","Gateway":"192.168.1.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.1.1","Mac":"5C:CF:7F:72:F9:BF","Webserver":2,"WifiConfig":5}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS6 = {"StatusMQT":{"MqttHost":"omo","MqttPort":1883,"MqttClientMask":"flurlicht","MqttClient":"flurlicht","MqttUser":"sensor","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS7 = {"StatusTIM":{"UTC":"Sun Oct 28 08:08:25 2018","Local":"Sun Oct 28 09:08:25 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":1,"Sunrise":"07:30","Sunset":"17:37"}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS10 = {"StatusSNS":{"Time":"2018-10-28T09:08:25","Switch1":"OFF"}}
09:08:25 MQT: /ham/flurlicht/stat/STATUS11 = {"StatusSTS":{"Time":"2018-10-28T09:08:25","Uptime":"3T12:21:05","Vcc":2.766,"POWER":"OFF","Dimmer":57,"Color":"914800","HSBColor":"30,100,57","Channel":[57,28,0],"Scheme":0,"Width":1,"Fade":"ON","Speed":5,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"adblock","RSSI":58,"APMac":"F4:F2:6D:70:B2:19"}}}

To Reproduce

Steps to reproduce the behavior:
set fulltopic to /ham/%topic%/%prefix%/
set topic to flurlicht
set switchmode to 1
set switchtopic to flurlicht
send /ham/flurlicht/cmnd ON

Expected behavior

i should see in on the mqtt instance:

received: stat/flurlicht/POWER ON
expected: /ham/flurlicht/stat/POWER ON

Additional context
Related: #4133

Cheers!

@makefu makefu changed the title WS2812: Switch1: FULLTOPIC is ignored for WS2812 POWER and STATUS Oct 28, 2018
@arendst
Copy link
Owner

arendst commented Oct 28, 2018

You might want to change mqttclient from flurlicht to something else as it is used as fallback topic.

@makefu
Copy link
Author

makefu commented Oct 28, 2018

Hey! i am unsure what you mean by that. Is some misconfiguration of tasmota related to my issue?

@arendst
Copy link
Owner

arendst commented Oct 28, 2018

Yes, change the data of mqttclient to something different than your topic name.

Open the console and type mqttclient flurlicht2

@makefu
Copy link
Author

makefu commented Oct 28, 2018

Wow that really seems to have worked. How are these things related and why cant the fallback topic be the same as the main? Maybe this info can be added added somewhere in the documentation or the web interface.
It was not clear for me that the client config in the mqtt section maps to the fallback topic for the switch, which in turn will be used as main topic when the switch triggers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
troubleshooting Type - Troubleshooting
Projects
None yet
Development

No branches or pull requests

3 participants