Get PWM value in any way

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
darkchris90
Normal user
Posts: 6
Joined: 27 Aug 2019, 19:24

Get PWM value in any way

#1 Post by darkchris90 » 27 Aug 2019, 19:30

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

User avatar
grovkillen
Core team member
Posts: 3197
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Get PWM value in any way

#2 Post by grovkillen » 27 Aug 2019, 20:00

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.
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 :idea: :idea: :idea:

darkchris90
Normal user
Posts: 6
Joined: 27 Aug 2019, 19:24

Re: Get PWM value in any way

#3 Post by darkchris90 » 27 Aug 2019, 20:43

Good evening,

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

User avatar
grovkillen
Core team member
Posts: 3197
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Get PWM value in any way

#4 Post by grovkillen » 28 Aug 2019, 07:34

Using rules you create an event using the event command.

https://espeasy.readthedocs.io/en/lates ... Rules.html
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 :idea: :idea: :idea:

darkchris90
Normal user
Posts: 6
Joined: 27 Aug 2019, 19:24

Re: Get PWM value in any way

#5 Post by darkchris90 » 28 Aug 2019, 20:55

Ah ok, I thought you talked about something in the code, because of the internal variable. I will try it. Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests