Dummy device not send mqtt state

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bricololo
New user
Posts: 3
Joined: 01 Nov 2020, 14:39

Dummy device not send mqtt state

#1 Post by bricololo » 08 Jun 2024, 19:37

Hello,
Dummy device never send state to mqtt.
I tested dummy switch and dummy single.
It's ok with interval but it's an option and i don't want use that.
No problem with other device like switch or temperature.
Same problem with the last version.
I use mqtt explorer and home assistant
Any solution ? Thanks

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

Re: Dummy device not send mqtt state

#2 Post by Ath » 08 Jun 2024, 20:29

For a task to send out its data automatically to a controller, like MQTT, it has to have an interval set, or have some other trigger, optionally in the plugin code, to achieve that.
If you want to determine the exact moment the data of the Dummy task is sent, you can use the TaskRun command, or combine the setting of a value to the Dummy device with sending it out using the TaskValueSetAndRun command instead of just TaskValueSet.
If you have multiple values set to the Dummy device, you can use a combination of TaskValueSet and TaskValueSetAndRun to start a single batch of data being sent out.
/Ton (PayPal.me)

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

Re: Dummy device not send mqtt state

#3 Post by Ath » 08 Jun 2024, 20:29

bricololo wrote: 08 Jun 2024, 19:37 It's ok with interval but it's an option and i don't want use that.
What's the problem with having an Interval set here?
/Ton (PayPal.me)

bricololo
New user
Posts: 3
Joined: 01 Nov 2020, 14:39

Re: Dummy device not send mqtt state

#4 Post by bricololo » 08 Jun 2024, 21:41

It is a motorized valve, which is controlled with 2 GPIOs for 2s in one direction, then 2s in the other.
It can be controlled by MQTT and by a physical button on the ESP.
When I order the valve in MQTT, the status feedback does not work. If I set an interval, I get the status feedback but it is not instantaneous. I would like the status feedback, only when the valve changes.
With an interval of 5s, I use resources unnecessarily.

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

Re: Dummy device not send mqtt state

#5 Post by Ath » 08 Jun 2024, 21:52

bricololo wrote: 08 Jun 2024, 21:41 It is a motorized valve, which is controlled with 2 GPIOs for 2s in one direction, then 2s in the other.
It can be controlled by MQTT and by a physical button on the ESP.
When I order the valve in MQTT, the status feedback does not work. If I set an interval, I get the status feedback but it is not instantaneous. I would like the status feedback, only when the valve changes.
With an interval of 5s, I use resources unnecessarily.
Not sure how that relates to a Dummy device on ESPEasy... :?
You'd need either the Home Assistant MQTT controller to send commands to ESPEasy, or use the MQTT Import plugin for receiving values and responding to that using rules.
/Ton (PayPal.me)

bricololo
New user
Posts: 3
Joined: 01 Nov 2020, 14:39

Re: Dummy device not send mqtt state

#6 Post by bricololo » 08 Jun 2024, 21:54

Thank you very much Ath
I replaced TaskValueSet with TaskValueSetandRun and it works.
It's perfect

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

Re: Dummy device not send mqtt state

#7 Post by Ath » 08 Jun 2024, 21:58

bricololo wrote: 08 Jun 2024, 21:41 When I order the valve in MQTT, the status feedback does not work. If I set an interval, I get the status feedback but it is not instantaneous. I would like the status feedback, only when the valve changes.
Ah, you seem to expect that the task that sends out data also 'listens' to the same MQTT topic, but that's not the case.
A Controller only sends data to the configured server but to respond to MQTT values, you can either send a command to a .../cmd topic (see C005 documentation), or receive the value and process it using the MQTT Import plugin (P037).
/Ton (PayPal.me)

Post Reply

Who is online

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