http request doesn't alter value
Moderators: grovkillen, Stuntteam, TD-er
http request doesn't alter value
Dear ESPEasy professional,
being a newbie to this great software, I have a problem which I thought I had solved, but it's back:
when sending http requests I can easily activate the relais of my ESP using a browser, e.g.
http://<ip>/control?cmd=gpio,4,1
But when trying to alter a value it doesn't work (anymore):
http://<ip>/control?cmd=event,httpvalue=5
gives me a nice OK-reply but the cvalue hasn't change when I reload the devices tab
Thanks for help I thought I had it working already, but now it's not. Could it be 'cause I altered the RulesSet? I'm using mega-20190630.
Thanks for help
being a newbie to this great software, I have a problem which I thought I had solved, but it's back:
when sending http requests I can easily activate the relais of my ESP using a browser, e.g.
http://<ip>/control?cmd=gpio,4,1
But when trying to alter a value it doesn't work (anymore):
http://<ip>/control?cmd=event,httpvalue=5
gives me a nice OK-reply but the cvalue hasn't change when I reload the devices tab
Thanks for help I thought I had it working already, but now it's not. Could it be 'cause I altered the RulesSet? I'm using mega-20190630.
Thanks for help
Last edited by obod0002c on 10 Aug 2019, 23:38, edited 1 time in total.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: http request doesn't alter value
Sorry but I can't set the rules you're using. Please attach them in a "code" 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: http request doesn't alter value
Hm...
Honestly I can't see what you're doing with the "event,httpvalue=5" command in your rules...
"event" creates an event so you can for example test what happens if a temperature goes to a certain value.
For changing a dummy value I'd use TaskValueSet, in your example "TaskValueSet,3,1,5"
(Task 3, Value 1, set to 5)
Honestly I can't see what you're doing with the "event,httpvalue=5" command in your rules...
"event" creates an event so you can for example test what happens if a temperature goes to a certain value.
For changing a dummy value I'd use TaskValueSet, in your example "TaskValueSet,3,1,5"
(Task 3, Value 1, set to 5)
Regards
Shardan
Shardan
Re: http request doesn't alter value
A bit lengthy hence I thought a zip could be better.grovkillen wrote: ↑10 Aug 2019, 21:29 Sorry but I can't set the rules you're using. Please attach them in a "code" syntax.
As requested:
Code: Select all
on System#Boot do
gpio,4,0 // sicherheitshalber
TaskValueSet 2,1,2
// 2 = Task# in "Devices"
// 1 = erste Variable=Anzahl
// 2x Bewässern tgl. = default
endon
On Clock#Time=All,06:00 do
if [Bewaesserung#Anzahl] >= 1
gpio,4,1 // Relais ein
gpio,13,1 // rote LED ein
timerSet,1,75 // Timer auf 75 Sekunden setzen
endif
endon
On Clock#Time=All,16:00 do
if [Bewaesserung#Anzahl] >= 2
gpio,4,1 // Relais ein
gpio,13,1 // rote LED ein
timerSet,1,75 // Timer auf 75 Sekunden setzen
endif
endon
On Clock#Time=All,12:00 do
if [Bewaesserung#Anzahl] >= 3
gpio,4,1 // Relais ein
gpio,13,1 // rote LED ein
timerSet,1,75 // Timer auf 75 Sekunden setzen
endif
endon
On Clock#Time=All,22:00 do
if [Bewaesserung#Anzahl] = 4
gpio,4,1 // Relais ein
gpio,13,1 // rote LED ein
timerSet,1,75 // Timer auf 75 Sekunden setzen
endif
endon
On Rules#Timer=1 do
gpio,4,0 // Ende Bewässerung
gpio,13,0 // rote LED aus
endOn
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: http request doesn't alter value
Yes, like Shardan is pointing out, you haven't crashed an event. Maybe talk value set and run would be better?
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: http request doesn't alter value
sorry guys, but I don't understand what you're talking of. I'll try and put it in other words so maybe you understand me:
I simply want to set/alter a variable using an http command like this one
http://<ip>/control?cmd=event,<eventName>=<eventValue>
Thought the way to get it done was:
1. create a 'Generic - Dummy Device' and name it <eventName> and enable the device
2. name first variable to e.g. v1
3. set/alter the variable using http://<ip>/control?cmd=event,<eventName>=<eventValue>
4. new variable's value should now be visible in the device's section in column 'Values'
5. usage of the previously set variable in one of the rules, e.g. if [eventName#v1] = 1
But even step 4. doesn't work, hence step 5. not, too.
I simply want to set/alter a variable using an http command like this one
http://<ip>/control?cmd=event,<eventName>=<eventValue>
Thought the way to get it done was:
1. create a 'Generic - Dummy Device' and name it <eventName> and enable the device
2. name first variable to e.g. v1
3. set/alter the variable using http://<ip>/control?cmd=event,<eventName>=<eventValue>
4. new variable's value should now be visible in the device's section in column 'Values'
5. usage of the previously set variable in one of the rules, e.g. if [eventName#v1] = 1
But even step 4. doesn't work, hence step 5. not, too.
Re: http request doesn't alter value
Changing a dummy var's value does not use a event command. It uses the taskvalueset command.I simply want to set/alter a variable using an http command like this one
http://<ip>/control?cmd=event,<eventName>=<eventValue>
Working example:
Your screenshot shows the dummy var (httpvalue) is task #3. The value name (value1) is var #1.
If you wanted to change the dummy var's value to 5 then it would use this syntax:
Code: Select all
taskvalueset,3,1,5
Code: Select all
http://<espeasyip>/control?cmd=taskvalueset,3,1,5
Who is online
Users browsing this forum: No registered users and 92 guests