Remote pass variable to Dummy Device

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
aneo
New user
Posts: 5
Joined: 16 Jan 2019, 15:36

Remote pass variable to Dummy Device

#1 Post by aneo » 16 Jan 2019, 15:52

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.

ScreenShot932.png
ScreenShot932.png (36.71 KiB) Viewed 4390 times
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
Capture+_2019-01-16-15-46-35.png
Capture+_2019-01-16-15-46-35.png (32.12 KiB) Viewed 4390 times
Capture+_2019-01-16-10-10-03.png
Capture+_2019-01-16-10-10-03.png (46.18 KiB) Viewed 4390 times

FourIdGeek
New user
Posts: 8
Joined: 26 Jan 2019, 23:32

Re: Remote pass variable to Dummy Device

#2 Post by FourIdGeek » 27 Jan 2019, 18:25

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"

aneo
New user
Posts: 5
Joined: 16 Jan 2019, 15:36

Re: Remote pass variable to Dummy Device

#3 Post by aneo » 08 Feb 2019, 09:00

@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 :D

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Remote pass variable to Dummy Device

#4 Post by grovkillen » 08 Feb 2019, 09:01

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 :idea: :idea: :idea:

aneo
New user
Posts: 5
Joined: 16 Jan 2019, 15:36

Re: Remote pass variable to Dummy Device

#5 Post by aneo » 27 Feb 2019, 08:46

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.

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

peces
New user
Posts: 7
Joined: 22 Feb 2018, 22:51

Re: Remote pass variable to Dummy Device

#6 Post by peces » 12 Nov 2022, 03:48

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

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

Re: Remote pass variable to Dummy Device

#7 Post by Ath » 12 Nov 2022, 09:50

peces wrote: 12 Nov 2022, 03:48 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.
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)

Post Reply

Who is online

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