ESPeasy MQTT import long topic

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
kazmid
New user
Posts: 9
Joined: 04 Sep 2023, 20:25

ESPeasy MQTT import long topic

#1 Post by kazmid » 04 Sep 2023, 20:38

Good morning everyone,
Thank you for the opportunity to join the community.

I am trying to use ESPEasy with SUPLA devices.

What is SUPLA?
Polish project supported by the ZAMEL company that produces modules for roller shutters, gates, lighting, energy meters, etc.
https://github.com/SUPLA

Unfortunately, there is no connector for Supla in ESPEasy.

I want to use ESPEasy as a Daschboard https://github.com/chromoxdor/easyfetch Many thanks to the author great job.

The supla topic is long and unfortunately it cannot be used in the ESPEasy MQTT import plugin https://espeasy.readthedocs.io/en/lates ... /P037.html. Is there any option to enter longer topics?

Example

Code: Select all

supla/d53ad63a3b9541e364d7d0e3178dc6f5/devices/23624/channels/76321/state
Thank you in advance for your help

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESPeasy MQTT import long topic

#2 Post by Ath » 04 Sep 2023, 21:16

Is it correct that all your topics have the same prefix, this "supla/d53ad63a3b9541e364d7d0e3178dc6f5/" part?

In that case you can put that in the 'Prefix for all topics' input field, and put the rest of the topic, "devices/23624/channels/76321/state" in the MQTT Topic fields for the channels you want to receive.
/Ton (PayPal.me)

kazmid
New user
Posts: 9
Joined: 04 Sep 2023, 20:25

Re: ESPeasy MQTT import long topic

#3 Post by kazmid » 04 Sep 2023, 21:24

Hi Ath,
Is it correct that all your topics have the same prefix, this "supla/d53ad63a3b9541e364d7d0e3178dc6f5/" part?
Yes, even if they will be as a prefix to topic

Code: Select all

supla/f63ed63e3b9541a363d7d0e3178dc7d3/devices/23624/channels/76329/state/humidity
It's too long :(

there is no space for 4 letters

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESPeasy MQTT import long topic

#4 Post by Ath » 04 Sep 2023, 21:40

Hmm, and I assume there is no way of shortening those topics, possibly by using some kind of alias?

The topics have been limited in size, because of limited resources in these small controllers.
I have been working on extending the storage space reserved for these so called Custom settings, and I'll see if this can be applied to the MQTT Import plugin too.
/Ton (PayPal.me)

kazmid
New user
Posts: 9
Joined: 04 Sep 2023, 20:25

Re: ESPeasy MQTT import long topic

#5 Post by kazmid » 04 Sep 2023, 21:49

Unfortunately, the SUPLA manufacturer does not allow you to change the topic in the module configuration.

It would be great if we could increase the number of characters in these fields.

Unless there is some other way to import data and actions on entities from another provider

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

Re: ESPeasy MQTT import long topic

#6 Post by TD-er » 04 Sep 2023, 22:07

You could use some wildcards in your topic when subscribing it it.
Just assuming they have set the access control such that you can only read topics based on your user ID?

So the subscribe topic could be something like this:

Code: Select all

supla/#/devices/23624/channels/76329/state/humidity

kazmid
New user
Posts: 9
Joined: 04 Sep 2023, 20:25

Re: ESPeasy MQTT import long topic

#7 Post by kazmid » 04 Sep 2023, 22:13

TD-er
Thanks for the tip. I'll check tomorrow and let you know if it helped.

kazmid
New user
Posts: 9
Joined: 04 Sep 2023, 20:25

Re: ESPeasy MQTT import long topic

#8 Post by kazmid » 05 Sep 2023, 12:48

Hi All,
It was configured as follows:

Code: Select all

Prefix for all topics: supla/f65ad63e3b9741a363d5d0e3178dc7d3/

Code: Select all

MQTT Topic 1: devices/22845/channels/73274/set/on
Mapping

Code: Select all

Name = false Value = 0

Code: Select all

Name = true Value = 1
How to make a switch out of it?

Unfortunately using # doesn't work.

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESPeasy MQTT import long topic

#9 Post by Ath » 05 Sep 2023, 14:36

In Tools/Advanced the Rules should be enabled (first checkbox)
Then, in rules, you can add an event handler for the taskname#value1 to do anything with the mapped value, like:

Code: Select all

on MQTTImport#Value1 do
  if %eventvalue1%=0
    // Handle false state, f.e. switch a GPIO or (re)set a PWM output
  else
    // Handle true state, f.e. switch a GPIO or (re)set a PWM output
  endif
endon
If only a GPIO state has to be changed, the you can use the eventvalue directly:

Code: Select all

on MQTTImport#Value1 do
  GPIO,4,%eventvalue1% // To invert, change %eventvalue1% to !%eventvalue1%
endon
/Ton (PayPal.me)

kazmid
New user
Posts: 9
Joined: 04 Sep 2023, 20:25

Re: ESPeasy MQTT import long topic

#10 Post by kazmid » 05 Sep 2023, 14:48

Hi Ath,
Ok, I will check.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests