Plugins - how to upload to Playground?
Moderators: grovkillen, Stuntteam, TD-er
Plugins - how to upload to Playground?
Hi everyone, Can anyone point me to a step by step guide how to upload a new plugin to the Playground on Github, please? I have one in development which I'd like to share and ask for help from forum members. It's for an Analogue AC current sensor TA12-100.
TIA.
Andrew
TIA.
Andrew
Re: Plugins - how to upload to Playground?
it's nice that you want to give something back, but this sensor you are using is only a derivation of the ADC Plugin we already have... you read an analog value, this can be done with:
https://www.letscontrolit.com/wiki/index.php/Analog
and due to limited resources on the esp8266 is is not really a good idea to create a plugin for every new analog sensor, especially is they only differ in the calculation they are doing...
i had a quick look at you sensor (http://henrysbench.capnfatz.com/henrys- ... -tutorial/ and to me it seems like you could simply solve this with using the existing ADC Plugin with using a formula to do the calculations...
...if you still think we need a new plugin for it, best way would be to submit a pull request...
https://www.letscontrolit.com/wiki/index.php/Analog
and due to limited resources on the esp8266 is is not really a good idea to create a plugin for every new analog sensor, especially is they only differ in the calculation they are doing...
i had a quick look at you sensor (http://henrysbench.capnfatz.com/henrys- ... -tutorial/ and to me it seems like you could simply solve this with using the existing ADC Plugin with using a formula to do the calculations...
...if you still think we need a new plugin for it, best way would be to submit a pull request...
Re: Plugins - how to upload to Playground?
Hello @krikk, and thanks for the fast reply.
My plugin is indeed based on the Henrys Bench code for the Arduino, and on the Analog Plugin you referred to. The reason I felt it would be desirable to construct a new plugin was as follows.
As I'm wanting to measure mains alternating current at 50Hz, there is a need to identify the highest and lowest instantaneous current (which is measured as an analog voltage output from the sensor module) to provide the peak-to-peak current reading. The Henrys code (for Arduino) uses an interrrupt routine to sample the voltage many times in each 1/50th-second cycle of the AC, for a period of 5 seconds, and stores the highest (and lowest in some versions). The main loop then does the calculations to convert to AC current, just once every cycle of the main loop (5 secs). I could see this last part could be done in a formula in the existing Analog plugin, but would this provide a way of doing the interrupt code, which needs to run many times in a 50th of a second? It's that part which made me feel that a specific plugin was needed, which starts with the Analog Plugin and adds the interrupt code. Does my logic make sense, or is there a better way?
My plugin is indeed based on the Henrys Bench code for the Arduino, and on the Analog Plugin you referred to. The reason I felt it would be desirable to construct a new plugin was as follows.
As I'm wanting to measure mains alternating current at 50Hz, there is a need to identify the highest and lowest instantaneous current (which is measured as an analog voltage output from the sensor module) to provide the peak-to-peak current reading. The Henrys code (for Arduino) uses an interrrupt routine to sample the voltage many times in each 1/50th-second cycle of the AC, for a period of 5 seconds, and stores the highest (and lowest in some versions). The main loop then does the calculations to convert to AC current, just once every cycle of the main loop (5 secs). I could see this last part could be done in a formula in the existing Analog plugin, but would this provide a way of doing the interrupt code, which needs to run many times in a 50th of a second? It's that part which made me feel that a specific plugin was needed, which starts with the Analog Plugin and adds the interrupt code. Does my logic make sense, or is there a better way?
Re: Plugins - how to upload to Playground?
i also wanted to monitor current with espeasy, but i discarded the idea after reading all the info on https://learn.openenergymonitor.org/ele ... troduction about it, to sum it up, you need a faster sampling than the esp8266 can provide it, as far as i have read...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Plugins - how to upload to Playground?
I very much like the Analog Sensor plugin but wish there was a way to add information about formulas and setup within the wiki. I have a analog light sensor (BH1750) and have made a formula to present the value in a more relevant manner but I had to make the calculations myself. It would be great to have a place to post the setup (preferably the wiki).
Also the Analog Sensor plugin might be possible to update to have more outputs than it has today? I.e. high low values between outputs etc. etc.?
I don't think a separate plugin for each new type of device is a good approach, it will be very divergent in the long run.
Also the Analog Sensor plugin might be possible to update to have more outputs than it has today? I.e. high low values between outputs etc. etc.?
I don't think a separate plugin for each new type of device is a good approach, it will be very divergent in the long run.
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: Plugins - how to upload to Playground?
the BH1750 (i2c, not analog) sensor gives direct lux readings! ? ...what formula do you need there?
Re: Plugins - how to upload to Playground?
I'm pleased to say that I have had my Plugin for AC mains current working in its present (rather rough and ready) form for over a month, so it appears that the ESP8266 can handle it. In fact, the same module (NodeMCU with 4096 flash memory) is also measuring three temperatures (DS18B20's) and has a dummy variable and a rule to calculate the temperature difference between two of them. The interrupt routine to get the peak current is at the end of the plugin, which I based on other plugins which use interrupts. And it is sending data (AC RMS current, estimated power) as well as the temperatures reliably via MQTT to my openHAB system.
The issues I have are in a sense cosmetic. The AC current and power values being measured are not being displayed in the Devices page. I'll start another thread and attach my code in its present form together with screen shots, in the hope that people with more experience of writing plugins than me willkindly give me some advice.
The issues I have are in a sense cosmetic. The AC current and power values being measured are not being displayed in the Devices page. I'll start another thread and attach my code in its present form together with screen shots, in the hope that people with more experience of writing plugins than me willkindly give me some advice.

- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Plugins - how to upload to Playground?
First of all, I use a analog light resistor (not a BH1750, my mistake sorry). But anyways, I like the analog approach regarding light. LUX is a scientific unit more than practical. The analog value is converted to %, 0% is a dark room (1V), 100% is direct daylight/lamplight (3.3V).
Much easier to understand.
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: Plugins - how to upload to Playground?
Hi all, Thanks for the responses. There is obviously a lot of interest in Plugins and information to make them easier to use!
Just repeating my original question, can anyone point me to a short guide to help me upload a plugin to the Plugin Playground, please?
(I already have a Github account, which I've used to clone the ESPEasy dev7, - it's going the other way and submitting a new file to the playground which is not clear to me.)
Regards, AndrewJ.
Just repeating my original question, can anyone point me to a short guide to help me upload a plugin to the Plugin Playground, please?
(I already have a Github account, which I've used to clone the ESPEasy dev7, - it's going the other way and submitting a new file to the playground which is not clear to me.)
Regards, AndrewJ.
Re: Plugins - how to upload to Playground?
if you want to add something to a repository you do not have write access to you do a pull request from your fork:
see here how to do this:
https://www.letscontrolit.com/wiki/inde ... evelopment
especially: https://www.letscontrolit.com/wiki/inde ... To_ESPEasy
...it is all on the wiki...
see here how to do this:
https://www.letscontrolit.com/wiki/inde ... evelopment
especially: https://www.letscontrolit.com/wiki/inde ... To_ESPEasy
...it is all on the wiki...

Re: Plugins - how to upload to Playground?
Thanks, krikk, just the thing. 

Who is online
Users browsing this forum: Bing [Bot] and 12 guests