I want to send a value with a timestamp. I use sendtohttp and mqqt for this.
When I use the system variables "%lcltime% or %lcltime_am% only the date comes but not the time.
What am I doing wrong?
Greetings Dondolo
(mega-20191104)
SendToHTTP 192.xxx.xxx.xx,80,control?cmd=event,Wasser
SendToHTTP 192.xxx.xxx.xx,80,control?cmd=event,Time=%lcltime_am%
Publish %sysname%/Wassermeldung,Wasser
Publish %sysname%/Wlanstärke,%rssi%
Publish %sysname%/Zeitstempel,%lcltime_am%
value with the date and time.
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: value with the date and time.
You might need to have it as URL syntax?
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: value with the date and time.
ok thanks, what does that mean?
What should I do?
What should I do?
Re: value with the date and time.
Maybe the space between date and time is being interpreted as a parsing character. So try wrapping the var parameter with single quotes. Like this:
- Thomas
Code: Select all
Publish %sysname%/Zeitstempel,'%lcltime_am%'
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: value with the date and time.
You can also take it a stage further and publish it as a json string.
That means you could pack a number of data-items in the string.
Here's an example from one of my rule-sets.
Publish,node24/ir_detector,'{"ssid":"%ssid%","node_number":"node%unit%"}'
Notice the placing of the single quote marks around the json string.
That means you could pack a number of data-items in the string.
Here's an example from one of my rule-sets.
Publish,node24/ir_detector,'{"ssid":"%ssid%","node_number":"node%unit%"}'
Notice the placing of the single quote marks around the json string.
Re: value with the date and time.
Oh yes, both works, thank you very much!
Who is online
Users browsing this forum: No registered users and 3 guests