mqq instead of http to control pwm
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
mqq instead of http to control pwm
hi now i'm controlling pmw leds using commands like:
http://192.168.0.155/control?cmd=PWM,0,100
http://192.168.0.155/control?cmd=PWM,0,500
http://192.168.0.155/control?cmd=PWM,0,0
etc...
now is it possible to move from http to mosquitto?
what's are the command that i have to send to esp?
thanks so much!
http://192.168.0.155/control?cmd=PWM,0,100
http://192.168.0.155/control?cmd=PWM,0,500
http://192.168.0.155/control?cmd=PWM,0,0
etc...
now is it possible to move from http to mosquitto?
what's are the command that i have to send to esp?
thanks so much!
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: mqq instead of http to control pwm
Commands are the same. See here: https://espeasy.readthedocs.io/en/lates ... mmand.html
Topically you have this type of subscribed incoming topic:
%sysname%/#
Given that your units name is Hulk you would command it by sending the commands to this topic:
Hulk/cmd
Topically you have this type of subscribed incoming topic:
%sysname%/#
Given that your units name is Hulk you would command it by sending the commands to this topic:
Hulk/cmd
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
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
sorry but i try this:grovkillen wrote: ↑08 Jan 2019, 22:36 Commands are the same. See here: https://espeasy.readthedocs.io/en/lates ... mmand.html
Topically you have this type of subscribed incoming topic:
%sysname%/#
Given that your units name is Hulk you would command it by sending the commands to this topic:
Hulk/cmd
http comands=
http://192.168.0.155/control?cmd=PWM,0,400,1900
and it works perfectly
now my esp name is: wemos_155
so from shell i send the commands:
mosquitto_pub -t wemos_155 -m PWM,0,400,1900
but my light is now light on now, why?
thanks
p.s. i'm using mega-20190202
Last edited by megamarco83 on 19 Feb 2019, 21:54, edited 1 time in total.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: mqq instead of http to control pwm
Try this:
mosquitto_pub -t wemos_155/cmd -m PWM,0,400,1900
Code: Select all
mosquitto_pub -t wemos_155/cmd -m PWM,0,400,1900
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
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
hi, i tested but still not working
i open two shell in putty
1) just to see what i receive with commands:
2)second shell to send commands:
but if i use that command i see nothing inside the shell 1)
if i use the command:
i see the answer:
it seams that if i send a command that contain the / in the shell 1) i can see the topic received
p.s. i'm using mega-20190202
i open two shell in putty
1) just to see what i receive with commands:
Code: Select all
sudo mosquitto_sub -F "%U - %t - %p" -v -t 'wemos_155'
Code: Select all
sudo mosquitto_pub -t wemos_155/cmd -m PWM,0,400,1900
if i use the command:
Code: Select all
sudo mosquitto_pub -t wemos_155 -m PWM,0,400,1900
Code: Select all
pi@raspberrypi:~ $ sudo mosquitto_sub -F "%U - %t - %p" -v -t 'wemos_155'
1550609391.736067818 - wemos_155 - PWM,0,400,1900
it seams that if i send a command that contain the / in the shell 1) i can see the topic received
p.s. i'm using mega-20190202
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
need to set somethin in the options?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: mqq instead of http to control pwm
With your settings you would need to use this:
mosquitto_pub -t domoticz/out/cmd -m PWM,0,400,1900
But that would make all units fetch that command since they all listen to that topic?
I'm not familiar with Domoticz enough to help you out but I would first try to change the subscribe topic to %sysname%/# and see if everything still works alright.
mosquitto_pub -t domoticz/out/cmd -m PWM,0,400,1900
But that would make all units fetch that command since they all listen to that topic?
I'm not familiar with Domoticz enough to help you out but I would first try to change the subscribe topic to %sysname%/# and see if everything still works alright.
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: mqq instead of http to control pwm
@megamarco83: You should use an MQTT-helper device in which you specify the idx of the device in Domoticz.
If you define a dimmer in Domoticz the MQTT-helper even changes pwm according to Domoticz percentage.
If you define a dimmer in Domoticz the MQTT-helper even changes pwm according to Domoticz percentage.
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
but i'm not able to send mqtt message.
i try your suggestion and others try but withou success.
name of my esp = wemos_155
this is the shell to listen with commands:
Code: Select all
sudo mosquitto_sub -F "%U - %t - %p" -v -t 'wemos_155'
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
i create the device that is named test and i put the idx of my light in domoticz
now how i can control with mqtt?
what's the command?
the Controller Subscribe: required now to set as:
Code: Select all
domoticz/out
Code: Select all
%sysname%/#
thanks
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
hi grovkillengrovkillen wrote: ↑20 Feb 2019, 05:42 With your settings you would need to use this:
mosquitto_pub -t domoticz/out/cmd -m PWM,0,400,1900
But that would make all units fetch that command since they all listen to that topic?
I'm not familiar with Domoticz enough to help you out but I would first try to change the subscribe topic to %sysname%/# and see if everything still works alright.
finally i succeed on it.
the correct command is:
Code: Select all
sudo mosquitto_pub -t /wemos_155/cmd -m pwm,0,400,1900
i try to set as controller domoticz mqtt and put as controller subrive the same as openhab: /%sysname%/#
but it not work!!!
is it possible to correct this bug?
i need domoticz mqtt....
thanks
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: mqq instead of http to control pwm
Yes I guess that could be considered a bug. Please open a new issue on GitHub.
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: mqq instead of http to control pwm
You must keep subscribe topic to domoticz/out because that is the topic domoticz is publishing to.
-
- Normal user
- Posts: 230
- Joined: 13 Apr 2017, 23:09
Re: mqq instead of http to control pwm
open issue #2341grovkillen wrote: ↑21 Feb 2019, 05:33 Yes I guess that could be considered a bug. Please open a new issue on GitHub.
thanks
Who is online
Users browsing this forum: No registered users and 3 guests