Simple text after change gpio status

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
nobody@all
Normal user
Posts: 30
Joined: 09 Apr 2017, 23:27

Simple text after change gpio status

#1 Post by nobody@all » 29 Dec 2017, 22:04

Hello!
How can I send simple text to controller after change gpio status. What i want? see the status of my door key. When door are closed- switch is pushed on (i want to see locked) when door are open switch is pushed off (i want to se unlocked)
what funktion should I use? switch?
do i need for this rules?

Regards
nobody@all

nobody@all
Normal user
Posts: 30
Joined: 09 Apr 2017, 23:27

Re: Simple text after change gpio status

#2 Post by nobody@all » 01 Jan 2018, 19:47

ok. I spent all day trying to do something by my self and I am one step ahead.
Using switch input and some rules:

Code: Select all

on wlacznik#status do
 if [wlacznik#status]=0
 gpio,12,0
 endif
endon

on wlacznik#status do
 if [wlacznik#status]=1
 gpio,12,1
 endif
endon

i can send via mqtt door status 0/1 (0-unlocked, 1-locked)
now the hardest thing for me - how can i send no 0/1 but locked/unlocked
My I please someone for help?

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

Re: Simple text after change gpio status

#3 Post by grovkillen » 01 Jan 2018, 20:01

nobody@all wrote: 01 Jan 2018, 19:47 ok. I spent all day trying to do something by my self and I am one step ahead.
Using switch input and some rules:

Code: Select all

on wlacznik#status do
 if [wlacznik#status]=0
 gpio,12,0
 endif
endon

on wlacznik#status do
 if [wlacznik#status]=1
 gpio,12,1
 endif
endon

i can send via mqtt door status 0/1 (0-unlocked, 1-locked)
now the hardest thing for me - how can i send no 0/1 but locked/unlocked
My I please someone for help?
You'll have to use the publish command. Please study the wiki on rules.
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:

nobody@all
Normal user
Posts: 30
Joined: 09 Apr 2017, 23:27

Re: Simple text after change gpio status [SOLVED]

#4 Post by nobody@all » 01 Jan 2018, 20:19

I did not think it is so simple :D
my all rules

Code: Select all

on switch#status do
 if [switch#status]=0
 gpio,12,0
 endif
endon

on switch#status do
 if [switch#status]=1
 gpio,12,1
 endif
endon

on switch#status do
 if [switch#status]=0
 Publish door,open
 endif
endon

on switch#status do
 if [switch#status]=1
 Publish door,closed
 endif
endon
Thank You very very much :)
Regards

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

Re: Simple text after change gpio status

#5 Post by grovkillen » 01 Jan 2018, 20:21

Happy to have helped. :D
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:

nobody@all
Normal user
Posts: 30
Joined: 09 Apr 2017, 23:27

Re: Simple text after change gpio status

#6 Post by nobody@all » 01 Jan 2018, 20:54

last question.
When door change status locked/unlocked controller send two informations
from controller publish /%sysname%/%tskname%/%valname% /ESP_Easy/switch/status 0
and
door unlocked
How to set up to see only door unlocked?

edit
my bad :twisted:
i just erase topic and everything is ok.

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

Re: Simple text after change gpio status

#7 Post by grovkillen » 01 Jan 2018, 22:04

nobody@all wrote: 01 Jan 2018, 20:54 last question.
When door change status locked/unlocked controller send two informations
from controller publish /%sysname%/%tskname%/%valname% /ESP_Easy/switch/status 0
and
door unlocked
How to set up to see only door unlocked?

edit
my bad :twisted:
i just erase topic and everything is ok.
Just uncheck the "send to controller" in the settings for that device.
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:

Who is online

Users browsing this forum: Anthropic Claude Bot [bot] and 19 guests