Hi
Thanks for the answer. I need it the other way round.
I would like to read out time in sec from a mqtt channel.
For example, I have a slider in Home Assistant. For example, I have a slider in Home Assistant with which you can select a number between 0 and 25. This is then published via mqtt (shutter/Kirchen/4).
Now I would like to read the value from shutter/Kirchen/4 when calling the script to open the shutter and set it as delay_s.
I thought it would work like this:
setChannel 1 1
delay_s $CH4
setChannel 1 0
But $CH*** only refers to the channel of the device, right?
Added after 9 [hours] 10 [minutes]: I figured it out!
To publish from autoexec as usual with:
e. e.g.: publish TestTopic 55
then the topic TestTopic is "created" in Mqtt under the respective device and the value 55 is "saved" under TestTopic/get
If you now want to write values from Homeassistant, for example, and want to read them later in the Autoexec, you can do this as follows:
e.g. with a slider an input for the device. For example, change an InputNumber with a slider and then publish to TestTopic/set using script or automation in Mqtt!
It is important to publish to /set! Then you can access the value from the autoexec with $CHTestTopic!
I hope it is somewhat understandable. As soon as I'm finished, I'll post the complete code!
Greetings Silas