MQTT sniffer, why no text imports?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

MQTT sniffer, why no text imports?

#1 Post by mattlward » 26 Feb 2018, 06:27

I am using MQTT to shove data out to a couple of D1's with displays to display weather data and would like to include the direction of the wind. For example SSW or N. Kids and wife would not get degrees.

So, why can't text be sniffed?

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MQTT sniffer, why no text imports?

#2 Post by TD-er » 26 Feb 2018, 21:51

Perhaps global sync is an option here?

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: MQTT sniffer, why no text imports?

#3 Post by mattlward » 26 Feb 2018, 22:22

It would be but one of them would still need to accept the feed from MQTT that has letters in it.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MQTT sniffer, why no text imports?

#4 Post by grovkillen » 26 Feb 2018, 22:26

But using rules which convert the number to a letter shouldn't be a problem.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: MQTT sniffer, why no text imports?

#5 Post by mattlward » 26 Feb 2018, 22:36

You can do that with rules?

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: MQTT sniffer, why no text imports?

#6 Post by mattlward » 26 Feb 2018, 22:38

Speaking of rules... can one do an if, else, else, endif? I have not been able to get the second else to work...

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MQTT sniffer, why no text imports?

#7 Post by grovkillen » 27 Feb 2018, 06:54

Please study the wiki tutorials for the if else.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: MQTT sniffer, why no text imports?

#8 Post by mattlward » 27 Feb 2018, 14:44

I have studied that and it does not make sense to me...

I see that I need this section:
BUT, only simple if/else is possible - so nesting and Boolean logic are not supported. However there is a workaround for the limitation of not being able to nest. An "event" can be called from a "trigger".

on <trigger> do
if <test1>
event <EventName1>
endif
endon

on <EventName1> do
if <test2>
<action>
endif
endon

I am trying to use a button to change the OLED contrast from high to medium to low and finally to off.

The other thing I am trying to make work is conversion of degrees to letter values and without multiple else checks I do not see how to make that work either. I will keep at it.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: MQTT sniffer, why no text imports?

#9 Post by grovkillen » 27 Feb 2018, 15:14

You could try this for the contrast.

Code: Select all

On Switch#Button Do
 If [Dummy#Value1]>2
  TaskValueSet,2,1,0
  Event,SetToOff
 Else
  TaskValueSet,2,1,[Dummy#Value1]+1
 EndIf

If [Dummy#Value1]=1
 Event,SetToLow
EndOn

If [Dummy#Value1]=2
 Event,SetToMed
EndOn

If [Dummy#Value1]=3
 Event,SetToHigh
EndOn
Endon

//Below is events

On SetToOff Do
 OLEDFRAMEDCMD,Off
EndOn

On SetToLow Do
 OLEDFRAMEDCMD,Low
EndOn

On SetToMed Do
 OLEDFRAMEDCMD,Med
EndOn

On SetToHigh Do
 OLEDFRAMEDCMD,High
EndOn
For the degree to direction you could do something similar.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: MQTT sniffer, why no text imports?

#10 Post by mattlward » 27 Feb 2018, 15:43

I have always kinda wondered what the dummy values were for and I could not see a use.

I will try working on that and thanks for your input, still learning and building.

Thanks Matt

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests