Page 1 of 1

Get PWM value in any way

Posted: 27 Aug 2019, 19:30
by darkchris90
Hi,

is it possible to get the current PWM status in the version 20190817? I need it for fhem. In some early versions it was in the state variable but now there is only 0,1,-1 and sometimes -2.

Where can I change the source code to get the value? I changed the code on my own and tried to modify the globalMapPortStatus directly or with the function savePortStatus. I prepared a struct which has the PWM value in the state and the output variable, but it doesnt work. I also changed the type of state to uint16_t like in the older versions.

Thanks

Re: Get PWM value in any way

Posted: 27 Aug 2019, 20:00
by grovkillen
I use a custom event and send the wanted value, which I store as in internal variable as well as setting the pwm.

So conclusion, you cannot get the value any other way currently.

Re: Get PWM value in any way

Posted: 27 Aug 2019, 20:43
by darkchris90
Good evening,

thank you for the fast answering. Can you explain the custom event and how to use it?

Re: Get PWM value in any way

Posted: 28 Aug 2019, 07:34
by grovkillen
Using rules you create an event using the event command.

https://espeasy.readthedocs.io/en/lates ... Rules.html

Re: Get PWM value in any way

Posted: 28 Aug 2019, 20:55
by darkchris90
Ah ok, I thought you talked about something in the code, because of the internal variable. I will try it. Thank you!