Try send commands.
Moderators: grovkillen, Stuntteam, TD-er
Try send commands.
Hi guys! Please help me, I try send mqtt to espeasy mega all night. How did that? I want build rgb led strip (not adress), but esp not accept commands. thks!
Re: Try send commands.
Welcome to this forum.
You will need to provide more information than this before anyone can help you, (and my crystal ball is quarantined because of Covid-19. )
- What hardware are you using
- How is it all connected up
- What version of ESPEasy do you have installed on the ESP (name of the .bin file is the most informative)
- How are your devices configured
- What commands have you tried
You will need to provide more information than this before anyone can help you, (and my crystal ball is quarantined because of Covid-19. )
- What hardware are you using
- How is it all connected up
- What version of ESPEasy do you have installed on the ESP (name of the .bin file is the most informative)
- How are your devices configured
- What commands have you tried
/Ton (PayPal.me)
Re: Try send commands.
And what controller are you using?
The OpenHAB/HomeAssistant controller is the most generic one.
@Ath: We should add a documentation section on how to send commands over MQTT (OpenHAB/HomeAssistant) as it keeps raising questions
The OpenHAB/HomeAssistant controller is the most generic one.
@Ath: We should add a documentation section on how to send commands over MQTT (OpenHAB/HomeAssistant) as it keeps raising questions
Re: Try send commands.
Im use openHAB, in my raspberry mosquitto.
Re: Try send commands.
Hm that Domoticz Helper won't work with your HA server, so that can be removed from your devices list.
Are you sure you don't need to enter credentials for the HA server? Usually that's required, AFAIK, but I don't have HA installed so I'm not sure.
Are you sure you don't need to enter credentials for the HA server? Usually that's required, AFAIK, but I don't have HA installed so I'm not sure.
/Ton (PayPal.me)
Re: Try send commands.
If you connect the ESP via USB you can start the Serial monitor from the ESPEasy.Flasher tool, to view the logs on the ESP (that's usually much easier then via the web log).
Do you see successful connection attempts for the HA MQTT controller, and also from the MQTT Import plugin, in the log output?
Do you see successful connection attempts for the HA MQTT controller, and also from the MQTT Import plugin, in the log output?
/Ton (PayPal.me)
Re: Try send commands.
Yeah! Thanks sooo!!! That's help me^^
One more question: how I can send value form topic to GPIO. I try "Generic - MQTT Import" and "Regulator - Level Control" but this can only I/O not 0-255 value.
One more question: how I can send value form topic to GPIO. I try "Generic - MQTT Import" and "Regulator - Level Control" but this can only I/O not 0-255 value.
Re: Try send commands.
When using the Generic MQTT Import you can add a rule (Rules and Old Engine must both be enabled on Tools/Advanced page) that gets triggered by the value change:
Code: Select all
on sniff#State do
GPIO,8,%eventvalue% // on/off
endon
/Ton (PayPal.me)
Re: Try send commands.
Nope, if there is no %eventvalue4%, then it will not be replaced. (same for 3, 2, etc.)
Re: Try send commands.
Code: Select all
14581238 : Info : ACT : GPIO,14,192.00
14581245 : Info : GPIO : port#14: set to 1
Re: Try send commands.
You probably need the PWM command, that works like GPIO, but instead of a 0/1 it accepts a duty cycle value from 0 to 1023, you can recalculate from 0-100 or 0-255 by using a LET command (LET,varnr,calculation_goes_here), and then use the result to pass to the PWM command (PWM,14,[VAR#varnr] (the square brackets are part of the variable expansion, f.e. [var#1] if you used let,1,%eventvalue%*10.23 to re-calculate the 0-100 range))
Code: Select all
on sniff#state do
let,1,%eventvalue%*10.23 // Range 0-100 -> 0-1023
pwm,14,[var#1] // Set GPIO14 to pwm with calculated dutycycle
endon
/Ton (PayPal.me)
Re: Try send commands.
Hi Ath. Please help me. My last question) I send to esp "255,170,84" that means red, green, blue channels for GPIO. How I can do that. Write rules or what I need. Thks! Best regards.
Re: Try send commands.
I hope you have read the documentation on Rules, over here
Currently, you would have to send an active command to your ESP, containing these values, in a command like this:
And then create a rule on your ESP to receive that:
Edit: Range adjustment added (see comment below)
Currently, you would have to send an active command to your ESP, containing these values, in a command like this:
Code: Select all
http://ip.of.esp.unit/control?cmd=event,externalrgb=255,170,84
Code: Select all
on ExternalRGB do
PWM,12,%eventvalue1%*4 // R (multiplied by 4 to adjust to 0..1023 range)
PWM,13,%eventvalue2%*4 // G
PWM,14,%eventvalue3%*4 // B
endon
Last edited by Ath on 27 Jan 2021, 10:57, edited 2 times in total.
/Ton (PayPal.me)
Re: Try send commands.
Please note the PWM has a 10 bit range, so you may want to multiply the values by 4.
Re: Try send commands.
Hi guys! I spend my time 3 days) How I can Send mqtt to RGB-Strip? I need use 2 plugins with 2 led strips. Thks you frends!
Plugin is
Plugin is
Topic to try send is /ESP_Easy/HSV value 30,67,99
Re: Try send commands.
That screenshot does look like a really old version of ESPEasy.
See here for newer versions: https://github.com/letscontrolit/ESPEasy/releases
Apart from that the playground plugin is not part of the build, but what makes that specific plugin better than the plugins we now have in the mega branch?
See here for newer versions: https://github.com/letscontrolit/ESPEasy/releases
Apart from that the playground plugin is not part of the build, but what makes that specific plugin better than the plugins we now have in the mega branch?
Re: Try send commands.
In the new firmware, I cannot use the plugins from homebridge and Esp_Easy to control the LED strips
Re: Try send commands.
Why not?
Does the plugin no longer compile on newer versions of ESPEasy?
Does the plugin no longer compile on newer versions of ESPEasy?
Re: Try send commands.
Yeap, this plugin not compile in newer versions.
Re: Try send commands.
Are we talking about this, really really old, plugin that's not even in the PluginPlayground? It actually needs a big renovation.
Edit:
Ah, I've just found it, P142 in the PluginPlayground
Edit:
Ah, I've just found it, P142 in the PluginPlayground
/Ton (PayPal.me)
Re: Try send commands.
Yes, if add it to the compilation and the library it uses FastLED version 3.1.8. then it throws a compilation error.
Re: Try send commands.
Other plugin "_P142_RGB-Strip" have error compile too ...
Re: Try send commands.
Can you fix code this plugins for good compilation?
_P142_RGB-Strip.ino
_P141_LedStrip.ino
_P142_RGB-Strip.ino
_P141_LedStrip.ino
Re: Try send commands.
About compilation errors in general:
Start with looking at the first error that occurs, the compiler gets really upset once it sees an error, and often, a single error causes dozens, or even hundreds of 'collateral damage' errors. Fixing that first and retrying will often reduce the amount of errors drastically.
Not sure about that FastLed library, it seems to trigger a lot of compile errors, most likely because it is not updated for modern C++ compilers.
This one is quite easy to fix, it exists in most of the PluginPlayground sources:
should be adjusted by adding "Sensor_VType::" resulting in:
I'll have a look at those plugins sometime during the weekend, I've got a few other ESPEasy projects at hand, switching halfway is a bit disturbing.
NB: Adding screenshots of code-like stuff, like error logs, is quite hard to reply to, better wrap parts of the logs into [ code ] [ /code ] (without the spaces) tags in your post (the </> button in the toolbar)
Start with looking at the first error that occurs, the compiler gets really upset once it sees an error, and often, a single error causes dozens, or even hundreds of 'collateral damage' errors. Fixing that first and retrying will often reduce the amount of errors drastically.
Not sure about that FastLed library, it seems to trigger a lot of compile errors, most likely because it is not updated for modern C++ compilers.
This one is quite easy to fix, it exists in most of the PluginPlayground sources:
Code: Select all
Device[deviceCount].VType = SENSOR_TYPE_TRIPLE;
Code: Select all
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TRIPLE;
NB: Adding screenshots of code-like stuff, like error logs, is quite hard to reply to, better wrap parts of the logs into [ code ] [ /code ] (without the spaces) tags in your post (the </> button in the toolbar)
/Ton (PayPal.me)
Re: Try send commands.
The typedef boolean is something that should not have been in any Arduino library as it is already defined in Arduino.h
So that typedef in the library should be removed.
So that typedef in the library should be removed.
Re: Try send commands.
Now its :Ath wrote: ↑29 Jan 2021, 07:52 About compilation errors in general:
Start with looking at the first error that occurs, the compiler gets really upset once it sees an error, and often, a single error causes dozens, or even hundreds of 'collateral damage' errors. Fixing that first and retrying will often reduce the amount of errors drastically.
Not sure about that FastLed library, it seems to trigger a lot of compile errors, most likely because it is not updated for modern C++ compilers.
This one is quite easy to fix, it exists in most of the PluginPlayground sources:should be adjusted by adding "Sensor_VType::" resulting in:Code: Select all
Device[deviceCount].VType = SENSOR_TYPE_TRIPLE;
I'll have a look at those plugins sometime during the weekend, I've got a few other ESPEasy projects at hand, switching halfway is a bit disturbing.Code: Select all
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_TRIPLE;
NB: Adding screenshots of code-like stuff, like error logs, is quite hard to reply to, better wrap parts of the logs into [ code ] [ /code ] (without the spaces) tags in your post (the </> button in the toolbar)
Code: Select all
/Users/power/Downloads/ESPEasy-mega/src/_P142_RGB-Strip.ino: In function 'boolean Plugin_142(byte, EventStruct*, String&)':
/Users/power/Downloads/ESPEasy-mega/src/_P142_RGB-Strip.ino:83:14: warning: unused variable 'tmpString' [-Wunused-variable]
char tmpString[128];
^
/Users/power/Downloads/ESPEasy-mega/src/_P142_RGB-Strip.ino: In function 'void Plugin_142_Output(float*)':
/Users/power/Downloads/ESPEasy-mega/src/_P142_RGB-Strip.ino:355:65: error: 'setPinState' was not declared in this scope
setPinState(PLUGIN_ID_142, pin, PIN_MODE_PWM, actRGBW[i]);
Code: Select all
// setPinState(PLUGIN_ID_001, CONFIG_PIN1, PIN_MODE_INPUT, switchstate[event->TaskIndex]);
Re: Try send commands.
That part of the setPinState...
Check the code in Servo.cpp (just one example) to see how it is now called:
Other examples just by searching for "setPinState" in the code.
Check the code in Servo.cpp (just one example) to see how it is now called:
Code: Select all
// setPinState(PLUGIN_ID_001, event->Par2, PIN_MODE_SERVO, event->Par3);
tempStatus.mode = PIN_MODE_SERVO;
savePortStatus(key, tempStatus);
log += F(" Servo set to ");
log += event->Par3;
addLog(LOG_LEVEL_INFO, log);
SendStatusOnlyIfNeeded(event, SEARCH_PIN_STATE, key, log, 0);
Re: Try send commands.
I did have a look at the code last night, but there are too many snags there for me to fix quickly/easily, so I'm letting this one go for someone else to tackle. And I don't have the hardware available, what would be a primary requirement to get this code properly tested.
Sorry.
/Ton (PayPal.me)
Who is online
Users browsing this forum: Bing [Bot] and 64 guests