Serial input to MQTT

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
redskinhu
New user
Posts: 4
Joined: 09 Apr 2018, 23:37

Serial input to MQTT

#1 Post by redskinhu » 17 Jun 2018, 23:25

Hello

I have a small problem. My esp is connected to the alarm system through serial to the rx/tx pins with level converter.
I use the Serial Server plugin. I would like to send the received data to my HASS server through MQTT. I created a rule to publish the recieved data.

Code: Select all

On !Serial# do
  publish home/ESP07/Alarm,%eventvalue%
Endon
If the esp get data from the alarm the !Serial# event is fired. Rule is working, it publish.

But i get this: home/ESP07/Alarm/!Serial#, doesn't matter what is the received data.

I know this plugin is not created to doing this. I thought maybe i can catch the data from the %eventvalue%. But not.... :(

Any idea how can i get the real data? Other plugin?

Thanks
T

xury
Normal user
Posts: 44
Joined: 02 Apr 2018, 12:54

Re: Serial input to MQTT

#2 Post by xury » 26 Jun 2018, 23:15

Hi I just read about your problem and I have an idea.

Code: Select all

On !Serial# do
  publish home/ESP07/Alarm,%eventvalue%
Endon
Because !Serial# does not have a value name.
You can try use a prefix on sending data as: myname= and after send your data
Obviously if you have an impact on the format of the data being sent to esp trough serial
When try a rule as:

Code: Select all

On !Serial#myname do
  publish home/ESP07/Alarm,%eventvalue%
Endon

dirk_k
Normal user
Posts: 19
Joined: 19 Aug 2017, 22:41

Re: Serial input to MQTT

#3 Post by dirk_k » 02 Jul 2018, 11:00

i use the following syntax

On Serial#myname do
publish home/ESP07/Alarm,[Serial#myname]
Endon

Post Reply

Who is online

Users browsing this forum: No registered users and 53 guests