Help you create the device rules for the following requirements
Moderators: grovkillen, Stuntteam, TD-er
Help you create the device rules for the following requirements
Help you create the device rules for the following requirements
1. is the control button on the off 1 relay (GPIO2)
2. is a mqtt server with the help of which is remotely controlled by 1 relay by topic /neopixel/relay1/status
for that
2 threads are created on the mqtt server
topics
/neopixel/relay1/switch
/neopixel/relay1/status
when the status changes /neopixel/relay1/Status
switching on (1) or switching off (0) relay1 occurs
and the value in the topic /neopixel/relay1/Switch changes switching on (1) or switching off (0)
thx
1. is the control button on the off 1 relay (GPIO2)
2. is a mqtt server with the help of which is remotely controlled by 1 relay by topic /neopixel/relay1/status
for that
2 threads are created on the mqtt server
topics
/neopixel/relay1/switch
/neopixel/relay1/status
when the status changes /neopixel/relay1/Status
switching on (1) or switching off (0) relay1 occurs
and the value in the topic /neopixel/relay1/Switch changes switching on (1) or switching off (0)
thx
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help you create the device rules for the following requirements
What are you wanting from us exactly?
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
![Idee :idea:](./images/smilies/icon_idea.gif)
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
Re: Help you create the device rules for the following requirements
I have Sonof BASIC and I really liked the project esp easy like custom software.
but I could not find a ready-made solution to manage Sonof BASIC using mqtt server
I've already figured out how to control the relay using a button but can not do it with a mqtt server with a reverse connection...
but I could not find a ready-made solution to manage Sonof BASIC using mqtt server
I've already figured out how to control the relay using a button but can not do it with a mqtt server with a reverse connection...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help you create the device rules for the following requirements
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
![Idee :idea:](./images/smilies/icon_idea.gif)
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
Re: Help you create the device rules for the following requirements
Thank you very much for your help
I almost found a rule what I wanted
I can remotely control the by URL code like
and that's not exactly what I wanted...
I'd like to manage relay by the topic change in the MQTT server like change /Sonoff_1M/relay/Switch/0 - lamp_off and Sonoff_1M/relay/Switch/1 lamp_on
and of course the button on the Sonoff device.
Thx.
I almost found a rule what I wanted
Code: Select all
on lamp_on do
gpio,12,1
gpio,13,0
endon
on lamp_off do
gpio,12,0
gpio,13,1
endon
on lamp_change do
if [relay#Switch]=1
event,lamp_off
else
event,lamp_on
endif
endon
on button#Switch do
event,lamp_change
endon
Code: Select all
http://IP/control?cmd=event,lamp_on
http://IP/control?cmd=event,lamp_off
I'd like to manage relay by the topic change in the MQTT server like change /Sonoff_1M/relay/Switch/0 - lamp_off and Sonoff_1M/relay/Switch/1 lamp_on
and of course the button on the Sonoff device.
Thx.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help you create the device rules for the following requirements
You send event,lamp_on or event,lamp_off to topic /Sonoff_1M/cmd and you get the and result.
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
![Idee :idea:](./images/smilies/icon_idea.gif)
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
Re: Help you create the device rules for the following requirements
Ok) thx Mqtt import that's exactly what I needed)
Code: Select all
on lamp_on do
Publish /%sysname%/state,1
gpio,12,1
gpio,13,0
endon
on lamp_off do
Publish /%sysname%/state,0
gpio,12,0
gpio,13,1
endon
on lamp_change do
if [relay#Switch]=1
event,lamp_off
else
event,lamp_on
endif
endon
[code]
on button#Switch do
event,lamp_change
endon
on rele_state#state=1 do
gpio,12,1
gpio,13,0
endon
on rele_state#state=0 do
gpio,12,0
gpio,13,1
endon
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help you create the device rules for the following requirements
Using MQTT import is over complicating I think. Why not use the "cmd" topic?
Or if you want to use MQTT import you should do this:
Or if you want to use MQTT import you should do this:
Code: Select all
on rele_state#state=1 do
event,lamp_on
endon
on rele_state#state=0 do
event,lamp_off
endon
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
![Idee :idea:](./images/smilies/icon_idea.gif)
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
Re: Help you create the device rules for the following requirements
The fact is that with a new start or when changing the name of a Unit Name: of this topic does not exist and control via MQTT will not work.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help you create the device rules for the following requirements
Ok I understand, but consider using my suggested change in the rule. It'll make it easier to maintain.
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
![Idee :idea:](./images/smilies/icon_idea.gif)
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
Re: Help you create the device rules for the following requirements
Thanks again for the help.
For my smart house (majordomo) I used different custom firmware until I chose on ESP Easy
Since I like it as a universal platform for sensors, relays and etc.
I have not really figured it out yet but I try not to miss the opportunity to acquire certain knowledge on the forum.
For my smart house (majordomo) I used different custom firmware until I chose on ESP Easy
Since I like it as a universal platform for sensors, relays and etc.
I have not really figured it out yet but I try not to miss the opportunity to acquire certain knowledge on the forum.
Re: Help you create the device rules for the following requirements
Is there an option for GPIOs (gpio/pcfgpio/mcpgpio) to publish their state w/o being declared as input switch in the Tasks ?grovkillen wrote: ↑30 Sep 2018, 09:17 Ok I understand, but consider using my suggested change in the rule. It'll make it easier to maintain.
/%sysname%/GPIO/<pin#>, <payload 0 or 1> changes the state of the pin w/o being declared as input but never publishes its state it back.
Was thinking something like :
gpio,12,0,1 Would initialize the controller state of the GPIO
{
"log": "GPIO 12 Set to 0",
"plugin": 1,
"pin": 12,
"mode": "output",
"state": 1,
"controller:1"
}
Would be handy saving up on the amount of tasks !!!
-D
-D
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help you create the device rules for the following requirements
Yes you can do it using rules. Not super simple (not like a setting) but very much workable.
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
![Idee :idea:](./images/smilies/icon_idea.gif)
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
![Idee :idea:](./images/smilies/icon_idea.gif)
Re: Help you create the device rules for the following requirements
I am thinking something like :grovkillen wrote: ↑07 Jan 2019, 22:13 Yes you can do it using rules. Not super simple (not like a setting) but very much workable.
on <gpio> do
Publish,%sysname%/<gpio>/<pin>,<state>
endon
So every time any gpio pin changes for any reason from any source, the Rule posts its new value
Not sure if this even possible outside of a Task or even the value's syntax...
-D
-D
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: Help you create the device rules for the following requirements
I think there is a command:
And I think
will give an event.
Mentioned here:
viewtopic.php?f=4&t=5868&p=31804&hilit= ... 2Cx#p31804
Also for:
monitor,PCF,<pin>
monitor,MCP,<pin>
Give it a try and share it with us.
Code: Select all
monitor,GPIO,<pin>
Code: Select all
On GPIO#<pin> Do
Mentioned here:
viewtopic.php?f=4&t=5868&p=31804&hilit= ... 2Cx#p31804
Also for:
monitor,PCF,<pin>
monitor,MCP,<pin>
Give it a try and share it with us.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: Help you create the device rules for the following requirements
(I am working on MCP,5)
This works :
on system#boot do
monitor,mcp,5
endon
On mcp#5=1 do
Publish,/%sysname%/MCP/5,1
endon
On mcp#5=0 do
Publish,/%sysname%/MCP/5,0
endon
Wondering if it is possible to post the value of MCP#5 directly, instead of conditioning ?
On mcp#5 do
Publish,/%sysname%/MCP/5,<mcp#5>
endon
To get by with a single event ?
-D
This works :
on system#boot do
monitor,mcp,5
endon
On mcp#5=1 do
Publish,/%sysname%/MCP/5,1
endon
On mcp#5=0 do
Publish,/%sysname%/MCP/5,0
endon
Wondering if it is possible to post the value of MCP#5 directly, instead of conditioning ?
On mcp#5 do
Publish,/%sysname%/MCP/5,<mcp#5>
endon
To get by with a single event ?
-D
-D
Re: Help you create the device rules for the following requirements
On mcp#5 do
Publish,/%sysname%/MCP/5,%eventvalue%
endon
This seems to work...
-D
Publish,/%sysname%/MCP/5,%eventvalue%
endon
This seems to work...
-D
-D
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 44 guests