Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P029 - MQTT Helper: device status not updated when GPIO is #1708

wdonker opened this issue Sep 4, 2018 · 3 comments


3 participants
Copy link

commented Sep 4, 2018

If you self compile, please state this and PLEASE try to ONLY REPORT ISSUES WITH OFFICIAL BUILDS!

Summarize of the problem/feature request

Using P029 Domoticz MQTT helper with a PWM output the device status is not always updated to the status of the GPIO. When switching PWM to 0 the actual GPIO output is set ok but the device status still shows the PWM value that was before.

512598182: EVENT: Temperatuur#Humidity=67.30
512598214: Domoticz: Sensortype: 2 idx: 102 values: 23.10;67.30;3
512614483: SW : GPIO 14 Set PWM to 450
512614487: EVENT: Testdimmer#Output=450.00
512621791: WD : Uptime 8544 ConnectFailures 0 FreeMem 20712
512624483: SW : GPIO 14 Set PWM to 0
512624487: EVENT: Testdimmer#Output=450.00

Expected behavior

Device status and GPIO should be the same at all times.

Actual behavior

See above.

Steps to reproduce

  1. Add a P029 device, connected to a dimmer in Domoticz.
  2. Switch on the dimmer to some PWM value in Domoticz.
    EspEasy device status and GPIO are now set to the same PWM value, e.g. 450.
  3. Switch off the dimmer in Domoticz (set PWM to 0.
    ESPEasy GPIO is now set to PWM 0, taskvalue of the device is still 450.

System configuration

Hardware: NodeMCU v2.0

ESP Easy version: mega-20180826 (and probably lots before)


This comment has been minimized.

Copy link

commented Sep 14, 2018

Is the thing I'm talking about the "bug" here or is this a real bug?


This comment has been minimized.

Copy link
Contributor Author

commented Sep 14, 2018

No, I think this is a real bug in C002.ino.

Code snippet (from line 100):
switch ((int)nvalue)

                    case 0:
                      pwmValue = 0;
                    case 1:
                      pwmValue = UserVar[baseVar];
                    case 2:
                      pwmValue = 10 * atol(svalue1);
                      UserVar[baseVar] = pwmValue;


It looks like the UserVar (DeviceValue?) is not updated in case 0 (pwmValue = 0).
I have not had time yet to test if this really is the bug.

@TD-er TD-er added this to To do in GPIO handling Oct 23, 2018

TD-er added a commit that referenced this issue Dec 6, 2018

Merge pull request #2126 from wdonker/mega
Fix P029 - MQTT Helper: device status not updated when GPIO is (#1708)

This comment has been minimized.

Copy link
Contributor Author

commented Dec 7, 2018

Fixed in release mega-20181207

@wdonker wdonker closed this Dec 7, 2018

GPIO handling automation moved this from To do to Done Dec 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.