Hi, I think I have something that is quite easy but somehow I dig 2nd day and cant sort it out.
I have:
1. Sonoff TH16 with ESP_Easy_mega-20190110_normal_ESP8266_1024.bin firmware. With connected Hum/Temp sensor.
2. I also have mosquitto broker
3. And MQTT Dash on android.
I want to pass variable (designated temperature) to dummy device /ni38th160/counter/settemp from my dashboard on phone. I have no problems changing the state of GPIO or reading the value of Dummy Device. But my goal is to place the logic onto device itself. Rules like TaskValueSet 4,2,19.5 works on device it self but f.e. if I want to do it form rule on other device (in P2P) or via dashbard (MQTT) I'm not able to. I did try to pass single digit with no luck as well. Can you give me a hint how to achieve this. After some reading I thought I could use MQTTImport plugin but I was not able to compile it. This is my settings on dashboard
Remote pass variable to Dummy Device
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 8
- Joined: 26 Jan 2019, 23:32
Re: Remote pass variable to Dummy Device
Hi, on the https://www.letscontrolit.com/wiki/inde ... _Reference page it says
"If you want to use internal or rules commands using HTTP/MQTT, setup an event within the rules section and remotely launch the "event" command."
Since the TaskValueSet is in the Rules class what you may need to do is create an event in your Rules to invoke the TaskValueSet, then call that event.
i.e.
on SetDummyValue do
TaskValueSet 4,2,%eventvalue%
endon
Then the MQTT topic would be "/ni38th160/cmd" with payload "event,SetDummyValue=19.5"
"If you want to use internal or rules commands using HTTP/MQTT, setup an event within the rules section and remotely launch the "event" command."
Since the TaskValueSet is in the Rules class what you may need to do is create an event in your Rules to invoke the TaskValueSet, then call that event.
i.e.
on SetDummyValue do
TaskValueSet 4,2,%eventvalue%
endon
Then the MQTT topic would be "/ni38th160/cmd" with payload "event,SetDummyValue=19.5"
Re: Remote pass variable to Dummy Device
@FourIdGeek Thanks you so much, I think I get it now. I was thinking that I can only trigger task event but I was not aware that I can pass value as well in it. Thank You again as soon I will find time I will test it but this means I should be able to build into device all I need to have
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Remote pass variable to Dummy Device
You can pass up to 4 values to an event.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Remote pass variable to Dummy Device
Just wanted to update everything is working as expected with value passing. The Mqtt Dash App is relay clean and cool but it cannot handle custom text value with switch options so in my HomeAssistant i use rephrasing the mgtt payload in automation rules.
So in this example my ni38th160cmd topic is not existing device and it is simply use to trasfer value data into string data onto esp device ni38th160.
So in this example my ni38th160cmd topic is not existing device and it is simply use to trasfer value data into string data onto esp device ni38th160.
Code: Select all
- id: '001'
alias: ni38th160-set-target-temp
trigger:
- platform: mqtt
topic: "/ni38th160cmd/termostat/settt"
condition: []
action:
- data_template:
payload: "event,sett={{trigger.payload}}"
topic: "/ni38th160/cmd"
service: mqtt.publish
Re: Remote pass variable to Dummy Device
Hi all,
I believe that my question is somewhat related to this topic.
I have values in home assistant that are calculated from an utility_meter, thus not being « MQTTed ».
I want to get those values on devices using espeasy in order to display them on local oleds or else.
Can someone point me to a way to exchange those non mqtt values from ha to espeasy ..
I believe there’s a better way than creating a dedicated mqtt sensor just only for that purpose for each utility_meter calculated variables.
Thanks
I believe that my question is somewhat related to this topic.
I have values in home assistant that are calculated from an utility_meter, thus not being « MQTTed ».
I want to get those values on devices using espeasy in order to display them on local oleds or else.
Can someone point me to a way to exchange those non mqtt values from ha to espeasy ..
I believe there’s a better way than creating a dedicated mqtt sensor just only for that purpose for each utility_meter calculated variables.
Thanks
Re: Remote pass variable to Dummy Device
This thread would have been helped a bit if it had a reference to the way ESPEasy can be sent commands to from external sources, or internal using the rules or the Command input from the Tools page.
So, commands can be sent as documented here: https://espeasy.readthedocs.io/en/lates ... mmand.html (first paragraph shows it all)
A simple way to control ESPEasy, when not using MQTT, from HA would be the HTTP method, that AFAIK can be used directly from the HA scripts (not a HA user here...)
/Ton (PayPal.me)
Who is online
Users browsing this forum: Google [Bot] and 92 guests