Hi all,
I would like to know how to import things ( at least booleans ) from Home Assistant to Espeasy so that some local actions can depend on them.
The Mqtt import plugin does not really suits my need for 2 reasons since (if i'm correct) :
-the MQTT message has to be published for the plugin to receive its thing (and so, espeasy does not get the value on a fresh boot)
-it is said that high-trafic topics will cause quite some load on the ESP and I don't want to risk that.
So would there be any more straightfw method so that espeasy asks Home assistant when needed : " what is the value of this boolean " for exemple at boot time and then deal with it.
Thanks for great work.
Method to import value from Home assistant
Moderators: grovkillen, Stuntteam, TD-er
Re: Method to import value from Home assistant
MQTT is not a Push/Pull system for transferring messages, but a Publish and Subscribe system (that's maybe a subtle difference), nicely described on this HiveMQ pagepeces wrote: ↑23 Oct 2023, 11:39 The Mqtt import plugin does not really suits my need for 2 reasons since (if i'm correct) :
-the MQTT message has to be published for the plugin to receive its thing (and so, espeasy does not get the value on a fresh boot)
-it is said that high-trafic topics will cause quite some load on the ESP and I don't want to risk that.
So would there be any more straightfw method so that espeasy asks Home assistant when needed : " what is the value of this boolean " for exemple at boot time and then deal with it.
Once you have the Retain option enabled for a topic (on the server/broker), the last value will be (re)published to the subscriber (=ESPEasy) when subscribing to the topic.
By making that subscription topic as specific as possible, you will only receive the messages for that topic (or topic-group), so the MQTT Import plugin is very well suited for this task
Using the Mapping feature you can convert the true/false values to a 1/0 (or similar) numeric value, so ESPEasy can process that nicely, f.e. from Rules.
Edit:
The same principle goes for the Subscribe topic in the Controller settings, if you don't need to receive other data or commands from that server, set it to a non-existing, or very low traffic, topic, so it won't overload the ESP.
/Ton (PayPal.me)
Re: Method to import value from Home assistant
Well, that's the perfect answer, thank you !
Adding " retain: true" into my home assistant mqtt.yaml config file + activating the retain options in espeasy controller tab did the trict.
Now the MQTT import plugin value is updated as soon as espeasy boots up and connects to broker.
Thanks again
Adding " retain: true" into my home assistant mqtt.yaml config file + activating the retain options in espeasy controller tab did the trict.
Now the MQTT import plugin value is updated as soon as espeasy boots up and connects to broker.
Thanks again
Who is online
Users browsing this forum: Bing [Bot] and 1 guest