Change Device State
Moderators: grovkillen, Stuntteam, TD-er
Change Device State
Hi everybody.
i hope i don´t ask a very stuoid question but:
i make a rule witch is triggert by an mqtt imoirt.
that is working fine. so the first step what the incoming rule should do works fine.
in additional to this step i would like to change the Device-State.
Its a Switch Named "unten_links" and the Values are State 1 or 0.
I wan´t to change the state of this items.
but i don´t know how to do it in the rule or better i don´t find a solution.
i hope someone can help me.
Kind regards
Matthias
i hope i don´t ask a very stuoid question but:
i make a rule witch is triggert by an mqtt imoirt.
that is working fine. so the first step what the incoming rule should do works fine.
in additional to this step i would like to change the Device-State.
Its a Switch Named "unten_links" and the Values are State 1 or 0.
I wan´t to change the state of this items.
but i don´t know how to do it in the rule or better i don´t find a solution.
i hope someone can help me.
Kind regards
Matthias
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Change Device State
Please post your settings and the rules so far.
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: Change Device State
Hi
here is my rule:
on MQTTIN#State1 do
if [MQTTIN#State1]=0
GPIO,15,0
[oben_links#State]==0
else
GPIO,15,1
endif
endon
The Switch oben_links is a normal switch
here is my rule:
on MQTTIN#State1 do
if [MQTTIN#State1]=0
GPIO,15,0
[oben_links#State]==0
else
GPIO,15,1
endif
endon
The Switch oben_links is a normal switch
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Change Device State
[oben_links#State]==0 isn't valid syntax. You need to use task value set...
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: Change Device State
That's not valid rules syntax.
Maybe this will work?
Code: Select all
on MQTTIN#State1 do
GPIO,15,[MQTTIN#State1]
endon
Re: Change Device State
Does TaskValueSet work on all plugins?grovkillen wrote: ↑18 Mar 2020, 10:30 [oben_links#State]==0 isn't valid syntax. You need to use task value set...
Re: Change Device State
i wan´t to set the value from:
[MQTTIN#State1]
i don´t want to use it.
i wan´t to change the gpio like it is and that worked.
but i wan´t to change the state of the Switch
so if the rule trigger switch state change from 1 to 0 via MQTT
[MQTTIN#State1]
i don´t want to use it.
i wan´t to change the gpio like it is and that worked.
but i wan´t to change the state of the Switch
so if the rule trigger switch state change from 1 to 0 via MQTT
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Change Device State
I think so yes?TD-er wrote: ↑18 Mar 2020, 10:32Does TaskValueSet work on all plugins?grovkillen wrote: ↑18 Mar 2020, 10:30 [oben_links#State]==0 isn't valid syntax. You need to use task value set...
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: Change Device State
i just read the TaskValueSet.
but i´m not sure if i understand it the right way
but i´m not sure if i understand it the right way
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Change Device State
Sorry but I have a hard time understand what your goal is. Please try to make a concise description what you're trying to achieve.
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: Change Device State
Ok here my case.
i build a 4 butto switch with 4 led with espeasy
if i push a botton i send a http request to openhab witch chane a switch there.
like this:
Openhab than did everything fine and push an mqtt update to my broker
ESPEASY grab that and turn on / turn off the LEDs
like this.
now you can change the switch in openhab itself and if that happend the led will turn on or off but in this way the state in espeasy is different than in openhab.
no i want to greb the same state as for the led and change the "Value" of the "State" from the Button.
hope now there is a way to understand it.
thanke
i build a 4 butto switch with 4 led with espeasy
if i push a botton i send a http request to openhab witch chane a switch there.
like this:
Code: Select all
on oben_links#State do
SendToHTTP x.x.x.x,8080,/classicui/CMD?sw001=[oben_links#State#O#P1]
endon
ESPEASY grab that and turn on / turn off the LEDs
like this.
Code: Select all
on MQTTIN#State1 do
if [MQTTIN#State1]=0
GPIO,15,0
else
GPIO,15,1
endif
endon
no i want to greb the same state as for the led and change the "Value" of the "State" from the Button.
hope now there is a way to understand it.
thanke
Re: Change Device State
Why don't you use the OpenHAB controller then?
The Domoticz and OpenHAB controllers have some logic in them to act on responses sent via the controller for some specific plugins.
The switch plugin is one of them.
The Domoticz and OpenHAB controllers have some logic in them to act on responses sent via the controller for some specific plugins.
The switch plugin is one of them.
Re: Change Device State
i want to build an hardware switch.
like the attached image
like the attached image
- Attachments
-
- 20200318_145326.jpg (346.36 KiB) Viewed 13974 times
Re: Change Device State
I meant the OpenHAB controller in ESPEasy.
Re: Change Device State
i´m sorry where did i find it?
Re: Change Device State
See the documentation: https://espeasy.readthedocs.io/en/lates ... oller.html
It is the controller tab in the web interface.
It is the controller tab in the web interface.
Re: Change Device State
i use MQTT to send and recive data but how can i get the "Generic Switch" Worked with it to send an recive data?TD-er wrote: ↑18 Mar 2020, 16:29 See the documentation: https://espeasy.readthedocs.io/en/lates ... oller.html
It is the controller tab in the web interface.
Re: Change Device State
This is quite basic info on how to operate ESPEasy.
You create a controller (on the controller tab) and remember its ID nr (1, 2 or 3) and make sure it is enabled.
Then, as soon as you have an enabled controller, you will see it also appear on the config page of a specific task (devices tab).
There you select the controller you would like to send data to (the 1, 2 or 3) and save.
N.B. A task can have 0 ... 3 controllers.
N.B.2. A task is using a plugin and multiple tasks can use the same plugin (e.g. multiple instances of the Dallas 1-wire temp sensor)
When a task is run, it will deliver some new values and hand them over to the selected controller of that task.
This controller will then make sure the data is delivered to the configured end point. For example Domoticz or OpenHAB MQTT, some HTTP server, etc.
A task is run at either a set interval (see task config page, almost at the bottom) or when you call taskrun from the rules.
You create a controller (on the controller tab) and remember its ID nr (1, 2 or 3) and make sure it is enabled.
Then, as soon as you have an enabled controller, you will see it also appear on the config page of a specific task (devices tab).
There you select the controller you would like to send data to (the 1, 2 or 3) and save.
N.B. A task can have 0 ... 3 controllers.
N.B.2. A task is using a plugin and multiple tasks can use the same plugin (e.g. multiple instances of the Dallas 1-wire temp sensor)
When a task is run, it will deliver some new values and hand them over to the selected controller of that task.
This controller will then make sure the data is delivered to the configured end point. For example Domoticz or OpenHAB MQTT, some HTTP server, etc.
A task is run at either a set interval (see task config page, almost at the bottom) or when you call taskrun from the rules.
Re: Change Device State
yes all you write here is what i do.
i addad some screenshots.
but i want to change the state of the switches "device first 4" via MQTT not Send. i would like to recive"
i addad some screenshots.
but i want to change the state of the switches "device first 4" via MQTT not Send. i would like to recive"
- Attachments
-
- devices.png (73.96 KiB) Viewed 13924 times
-
- controller.png (36.82 KiB) Viewed 13924 times
Re: Change Device State
Nobody an idear how i can change the value of my input switch without pushing the botton
Re: Change Device State
i get it working, here is my solution:
Code: Select all
on oben_links#State do
SendToHTTP x.x.x.x,8080,/classicui/CMD?tuyasw001=[oben_links#State#O#P1]
GPIO,12,1
endon
on oben_rechts#State do
SendToHTTP x.x.x.x,8080,/classicui/CMD?tuyasw002=[oben_rechts#State#O#P1]
endon
on unten_links#State do
SendToHTTP x.x.x.x,8080,/classicui/CMD?tuyasw003=[unten_links#State#O#P1]
endon
on unten_rechts#State do
SendToHTTP x.x.x.x,8080,/classicui/CMD?tuyasw004=[unten_rechts#State#O#P1]
endon
on MQTTIN#State1 do
if [MQTTIN#State1]=0
GPIO,15,0
else
GPIO,15,1
endif
endon
on MQTTIN#State2 do
if [MQTTIN#State2]=0
GPIO,2,0
GPIO,2,0
else
GPIO,2,1
endif
endon
on MQTTIN#State3 do
if [MQTTIN#State3]=0
GPIO,4,0
else
GPIO,4,1
endif
endon
on MQTTIN#State4 do
if [MQTTIN#State4]=0
GPIO,0,0
else
PWM,0,100
endif
endon
on MQTTIN#State1 do
if [MQTTIN#State1]= 0 and [oben_links#State] = 1
GPIO,12,0
timerSet,1,1
endif
endon
on MQTTIN#State1 do
if [MQTTIN#State1]= 1 and [oben_links#State] = 0
GPIO,12,0
timerSet,1,1
endif
endon
on MQTTIN#State2 do
if [MQTTIN#State2]= 0 and [oben_rechts#State] = 1
GPIO,5,0
timerSet,1,1
endif
endon
on MQTTIN#State2 do
if [MQTTIN#State2]= 1 and [oben_rechts#State] = 0
GPIO,5,0
timerSet,1,1
endif
endon
on MQTTIN#State3 do
if [MQTTIN#State3]= 0 and [unten_links#State] = 1
GPIO,12,0
timerSet,1,1
endif
endon
on MQTTIN#State3 do
if [MQTTIN#State3]= 1 and [unten_links#State] = 0
GPIO,12,0
timerSet,1,1
endif
endon
on MQTTIN#State4 do
if [MQTTIN#State4]= 0 and [unten_rechts#State] = 1
GPIO,13,0
timerSet,1,1
endif
endon
on MQTTIN#State4 do
if [MQTTIN#State4]= 1 and [unten_rechts#State] = 0
GPIO,13,0
timerSet,1,1
endif
endon
on Rules#Timer=1 do
GPIO,12,1
GPIO,14,1
GPIO,13,1
GPIO,5,1
endon
Re: Change Device State
Hi for everybody!
I need help in devices states send to Domoticz.
When I enable sending the state from the Device setting page, status value (1 or 0) sending in Domotics multiple times ,
while the notification set in Domoticzis constantly triggered and sends a lot of messages with the same status.
But i need ONLY ONE message with changed status! I tryed to create my one rules in ESPEasy, but faced the same problem - an event that should be sent once, when switching the relay, is sent multiple times !
on Relay2#state do
SendToHTTP 192.168.1.42,8080,/json.htm?type=command¶m=udevice&idx=2&nvalue=[Relay2#state]
endon
Please, help!
I need help in devices states send to Domoticz.
When I enable sending the state from the Device setting page, status value (1 or 0) sending in Domotics multiple times ,
while the notification set in Domoticzis constantly triggered and sends a lot of messages with the same status.
But i need ONLY ONE message with changed status! I tryed to create my one rules in ESPEasy, but faced the same problem - an event that should be sent once, when switching the relay, is sent multiple times !
on Relay2#state do
SendToHTTP 192.168.1.42,8080,/json.htm?type=command¶m=udevice&idx=2&nvalue=[Relay2#state]
endon
Please, help!
Re: Change Device State
Why you have an interval set it to 0 you don't need it for the switch maybe then it stops sending
Re: Change Device State
Can you post your rule and a part of your life when sending multiple times?
Who is online
Users browsing this forum: No registered users and 17 guests