Re: Communicating Between a Tasmota Sonoff Basic & a Win10 PC

742 views
Skip to first unread message
Message has been deleted

Phil

unread,
Feb 16, 2018, 10:05:47 PM2/16/18
to SonoffUsers
Hi Andy,

Have you got your tasmota system connected to a mqtt broker, if your not successfully hosting your own? one of the free web brokers can be used just to get things sorted https://github.com/mqtt/mqtt.github.io/wiki/public_brokers

fwiw im using mosquitto on a raspberry pi-zerow i think there is a windows version,  beyond installing and confirming its running ( a couple of python publish and subscribe scripts iirc..) there is nothing else to do.

in the tasmota mqtt config web page just point it at the puter hosting your mqtt broker 1883 is the default port , leave the uuid field alone, and unless you created any security when installing mosquitto dont provide any userid or password credentials ( unless you applied security in the install) only provide a topic test/mytest would work ;) 

once connected to a mqtt broker  go to the console page of the web interface and start entering commands and check out the message feedback and results.  things will start to fall into place pdq i am sure..  

Once tasmota is configured you can point any client puter at the mqtt broker and send/publish your sonoff commands via your topic path ;) 
  
 
.  

On Saturday, 17 February 2018 02:21:41 UTC, Andy Maddick wrote:

Am I doing it the hard way ?
I need a quick fix to get a single Sonoff Basic (Tasmota) running like this
1. Turn on relay (water pump) for 5 minutes (every hour)
(Single 5 min count down from a WiFi signal or 2x WiFi signals /on/off ?)
2. If tank floods it make a float switch go NO (or) NC
Float switch connected to GPIO14 is the plan..
This should send notification back to PC as event..
This event then stops the relay early
**OR** float switch toggles relay directly in Sonoff - then sends notification back to PC - this sounds faster - safer - never want an overflow of water from tank.
I have Sonoff Basics, a PC running Win10x64
various MQQT windows based programs (Domoticz, Mqtt.fx etc)
I just can not seem to get everything communicating as it should.
Sonoff from web browser works great
Help please.. anyone ?

Andy Maddick

unread,
Feb 16, 2018, 10:33:38 PM2/16/18
to SonoffUsers
Phil, 
Firstly I really appreciate the time you have given me with your reply :) 
mosquitto (windows 32 bit version) seems old 2006 - anyway it has dependencies that it doesn't come with, it tells you were to get them but they no longer exist in the files they suggest, I have searched for the missing files & dropped them into the program folder, but different versions of same files = different results = dull headache & ringing in ears... I haven't had it work right yet (face palm)
You said 'tasmota mqtt config web page' this is what loads from entering 'A Sonoff_IP into the browser ? 

Wish there was a dedicated tasmota firmware purpose written server.. 
I am wanting to code one - should be dead easy seeing devices usual respond to http commands making that communication 'bulletproof'
Need a handy list of all the http://sonoff_IP/commands ASAP - Know of one ? ;)
Yeah I guess my issue is my lack of broker - I need a free one that 'just works'
Cheers & thank-you Phil - I will now look at your links see what I learn from there

Phil

unread,
Feb 17, 2018, 12:09:07 AM2/17/18
to SonoffUsers
https://github.com/arendst/Sonoff-Tasmota/wiki/Commands

tasmota is its own web server,  point your web browser at your sonoff ip address and you should see the main menu page,  

if the windows version of mosquitto dosent simply install and work im afraid i know nothing having installed it on a pi.. 

but using a public broker will work, but there may be a more significant lag between issue and response. 

But once at the tasmota/sonoff main page the console will be one of the main options , and you can configure the mqtt settings under the configure menu.. 

at the console use the PulseTime command to set the 5minute delay, (there is another recent post on this subject)

you can try issuing commands at the console page without an mqtt broker set and connected but the display will be noisy with connection errors

Andy Maddick

unread,
Feb 18, 2018, 2:50:14 AM2/18/18
to SonoffUsers
Ok, I have made progress, so before anyone goes typing out a detailed reply to me hang back..
I have a MQTT broker up & running now awaiting further testing & evaluation
Cheers

Mike Roberts

unread,
Feb 18, 2018, 3:57:58 AM2/18/18
to SonoffUsers
Andy

In case it helps - this is my system using Node-Red to drive and on a Raspberry Pi.  I find Node-Red a very powerful interface (to the MQTT broker).  You can get Node-Red for Windows.


Mike

Andy Maddick

unread,
Feb 18, 2018, 12:45:11 PM2/18/18
to SonoffUsers
From my original post: An update on progress

Yes a single ON WiFi signal can be sent as which will start a count down timer
which the duration oif count down - can be set with this command (20 second example)
http://192.168.0.4/cm?cmnd=PulseTime%20120
As Default firmware setting..
If the 'Float Switch' reaches it's 'set height' before the 20 second ON cycle is up - it **will** turn relay off 
- the desired result, not reliant on a signal going out - being interpreted - then being sent back to turn relay off (what if signal got lost delayed = overflow = bad)
It will also report the change as if 'set height' has been reached but not as I expected or hoped for
The log effectively shows as if original toggle switch on the sonoff was pressed
MQT: stat/sonoff/RESULT = {"POWER":"OFF"}
I looked into different switches Switch1, Switch2, Switch3 & Switch4
As well as SwitchMode  & SwitchTopic..
Not really happy, the ideal is the first one, ALWAYS have the float switch stop the relay
BUT send MQTT (something) that is unique - so I can confirm water DID reach the desired level..
Message has been deleted

Andy Maddick

unread,
Feb 18, 2018, 12:52:29 PM2/18/18
to SonoffUsers
**EDIT..
Float Switch on GPIO14 in above post..
and

ALWAYS have the float switch stop the relay
better as
ALWAYS have the float switch stop the relay LOCALLY in the sonoff

Reply all
Reply to author
Forward
0 new messages