MQTT input in rules
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: MQTT input in rules
No problem to send HTTP commands using a web interface. Or what's the hiccups?
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: MQTT input in rules
i don't think the espeasy is really meant to be used as a control panel (of sorts). it's more for setting up the device to control things (motors, lights, etc). what you need is home automation software that sends the commands to the esp and then the esp makes it happen.
you need to be looking at openhab, domoticz, home assistant, etc.
Re: MQTT input in rules
So If I have understood currently ESPeasy is more to send an signal and the esp do it immediately and software like openhab is more hard coded and you have the logic in the esp( or sonoff)?
Re: MQTT input in rules
ESPeasy has a number of possibilities.
For example:
- Operate sensors/displays on a number of pins. (support for specific sensors is done in "Plugins" or "Tasks" as they are called in ESPeasy)
- Collect data from the sensors and do some simple computations on them. (Formulas at the bottom of each "plugin" page)
- Send sensor data to a number of typical data-collecting/processing units (they are called controllers in ESPeasy)
- Act on events and perform some time-based actions (Rules in ESPeasy)
Its possibilities are not limited to these, but in general it is the functionality of ESPeasy.
The controllers interface to some other tools, which are often more the general interface hubs of the home automation system.
For example Domoticz, OpenHAB, HomeAssistant, etc.
There is also a plugin called MQTT input, which is just plainly a hack, since it does not fit as plugin (a plugin interacts with hardware) and it is not used as a controller (what it should be)
Problem with the current implementation of controllers is that they're just sending data and not (yet) meant to collect data, so I get why it was written like it is now.
I hope it is now a bit more clear how each interacts with eachother.
N.B. this may (and will) change/shift in the future, but for now, that's how it is working.
Re: MQTT input in rules
Thank you for you reply but still nobody has answer my question. Can from the ESPeasy and maybe MQTT change the code from ESP( foe example sonoff)?
For example some how to say to sonoff turn on in 3 hour and after 4 hours turn off. And that will happened both when it is connected to the network and when it is not connected. I have found that it is possible throw MQTT message but MQTT works only when it is connected to the network because the message is turn onn/off NOW. I need a tool to do time scheduling. Do you know anything about that?
For example some how to say to sonoff turn on in 3 hour and after 4 hours turn off. And that will happened both when it is connected to the network and when it is not connected. I have found that it is possible throw MQTT message but MQTT works only when it is connected to the network because the message is turn onn/off NOW. I need a tool to do time scheduling. Do you know anything about that?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: MQTT input in rules
You can use event command and send a integer/float values as %eventvalue% and that value could be used as the timer duration.
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: MQTT input in rules
And you might store the %eventvalue% in a dummy variable so that it is still available when there is no network connection.
Re: MQTT input in rules
Dear IOT'ers,
Maybe someone here can help me also. My problem may be of a silimar one.
I have build a chickenbot with stepper motor in it driven on a Adafruit motorshield.
over HTTP the command works great, but now i am switching to MQTT.
No command seems to work :S
finally i found this thread, and it seems mayby i can solve my problem though a rule!
My rule right now in ESPEASY is:
This is just for testing, but it is an important one (otherwise the motor burns itself crisp)
on Chickenbot#Feeder=Release do
MotorShieldCMD,Stepper,1,Release
endon
My HA command is:
ChickenBot_4/Chickenbot (with the payload) Release
nothing happens
Regards,
Kirelam
Maybe someone here can help me also. My problem may be of a silimar one.
I have build a chickenbot with stepper motor in it driven on a Adafruit motorshield.
over HTTP the command works great, but now i am switching to MQTT.
No command seems to work :S
finally i found this thread, and it seems mayby i can solve my problem though a rule!
My rule right now in ESPEASY is:
This is just for testing, but it is an important one (otherwise the motor burns itself crisp)
on Chickenbot#Feeder=Release do
MotorShieldCMD,Stepper,1,Release
endon
My HA command is:
ChickenBot_4/Chickenbot (with the payload) Release
nothing happens
Regards,
Kirelam
Re: MQTT input in rules
There are at least a few misunderstandings in your code.
ESPEasy works with float and integer values. And though it is possible to trigger events based on string values, you can't store a string in a Dummy Device, so trying to send it over MQTT, to trigger an event on it, will not work.
Using "1" instead of "Release" should be able to work.
NB: I know nearly nothing about MQTT, so that side of the story I can't help you further, sorry.
ESPEasy works with float and integer values. And though it is possible to trigger events based on string values, you can't store a string in a Dummy Device, so trying to send it over MQTT, to trigger an event on it, will not work.
Using "1" instead of "Release" should be able to work.
NB: I know nearly nothing about MQTT, so that side of the story I can't help you further, sorry.
/Ton (PayPal.me)
Re: MQTT input in rules
Sending commands via MQTT should be done via the subscribed topic + /cmd
So if you subscribe to the topic
you should publish the ESPEasy commands to
So if you subscribe to the topic
Code: Select all
ChickenBot_4/Chickenbot
Code: Select all
ChickenBot_4/Chickenbot/cmd
Who is online
Users browsing this forum: Ahrefs [Bot] and 37 guests