Plugin Development

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Plugin Development

#1 Post by JustmeNL » 11 Jan 2017, 20:21

Hi,

I'm working on a plugin so I can embed a esp8266 in the display unit of my weather station (Ventus W266 aka Renkforce W205GU). The esp sniffs the SPI data between the processor and the receiver. This means I need 4 GPIO pins. I fixed the added GPIO pin by embedding this in the PLUGIN_WEBFORM_LOAD and storing my pins in the taskvars, does this create problems for future changes?

The weather stations outside unit monitors temperature, humidity, wind direction, wind average, wind gust, rainfall, uv radiation and lightning strike distance and strikes per interval. This is a bit more then the 4 values the framework can handle so I broke it up into one instance per sensor group. This works fine except that this means that each instance of the device type has a different sensor type.

Is there a way to differentiate the sensor type per instance instead of per device? I now solved this by adding a sensor type SENSOR_TYPE_CUSTOM 99 and let the framework check UserVar[event->BaseVarIndex + 3] for this sensor type to determine a new sensor type.

What would be a better way to do this?

Regards,

Justme

PS The latest release defines SENSOR_TYPE_TRIPLE and SENSOR_TYPE_QUAD but they are not implemented in the domoticz plugins. Maybe add this missing "feature" as a remark by the constant declarations?

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Plugin Development

#2 Post by chunter1 » 13 Feb 2017, 10:05

I just ordered a W266 and can't wait testing your plugin ;)

velja
Normal user
Posts: 31
Joined: 08 Feb 2017, 08:07

Re: Plugin Development

#3 Post by velja » 02 Apr 2017, 05:49

If you have information about Ventus w266 communication protocol, do you think that other Ventus weather station has the same comm. protocol and can be connected to esp? I have w232 and I like to use this plugin.

Mihadongle
Normal user
Posts: 25
Joined: 07 Jan 2016, 17:18

Re: Plugin Development

#4 Post by Mihadongle » 03 Apr 2017, 21:39

Hallo i have rebuild your profect. Great!
I have 2 bugs the the Gust in the wind device the value is not the same as on the display!
I must put this %value%*3.6 in formula field and now is ok!
And on domoticz all sensors display the value but the wind have no icon and when i go to protocol the side is blanc!
On the device page the wind sensor displays WTGR800 0, 247;WSW;0.0;0.0;0
Thats my problem
Best regards
Image

Image

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#5 Post by JustmeNL » 09 Apr 2017, 21:34

@velja

Sorry. I only know about the w266. I'm unfamilliar with the w232. If it is also @868MHz it might work but no assurances what so ever.

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#6 Post by JustmeNL » 09 Apr 2017, 21:35

@Mihadongle

Oh I'm sorry the wind is incorrect. Do you use mqtt for Domoticz or http?

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#7 Post by JustmeNL » 10 Apr 2017, 08:34

@velja

I checked into the w232 but it only has a temperature sensor as external sensorunit. It might work but the plugin can only show data from the external sensorunit.

You might be better of using a espmega with a bmp280, that will give you barometrics and temperature or the smaller bmp180 and a dht12 for barometrics, temp and hygro.

giobbe
Normal user
Posts: 19
Joined: 20 Mar 2017, 10:29

Re: Plugin Development

#8 Post by giobbe » 11 Apr 2017, 09:36

Hi,
I would use the Wemos motor shield (https://www.wemos.cc/product/motor-shield.html) with easy esp. I tried to insert the library in esp easy but it does not work. You can help me?
that soon it would be nice make plugin for Wemos Motor Shield,
as it is very common
This is a arduino library: https://github.com/wemos/WEMOS_Motor_Sh ... no_Library
Thanks
Giobbe

Zodiac69
Normal user
Posts: 85
Joined: 13 Jun 2016, 17:20

Re: Plugin Development

#9 Post by Zodiac69 » 17 Jun 2017, 06:15

During the development of this Plug-in, did you manage to capture the configuration settings of the RFM31b receiver?
I would like to use only the receiver without the display to send data to Domoticz.

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#10 Post by JustmeNL » 18 Jun 2017, 20:18

Hi,

Due to the age of the rfm31 and thus the deminished availabillity, Chunter1 created a plugin to use the rfm69 for capturing. This plugin can be found in the playground as P124_Ventus_W266_RFM69.

Zodiac69
Normal user
Posts: 85
Joined: 13 Jun 2016, 17:20

Re: Plugin Development

#11 Post by Zodiac69 » 20 Jun 2017, 20:58

Hi JustmeNL

Thank you for the pointer.
I shall have to see how i can get OOK to work on the RFM69 as i have one of these - [url]http://www.foshk.com/wifi_weather_stati ... 0.html[url]
I have been playing with the settings and i either get nothing... or continuous garbage.

My idea was to use EspEasy with local humidity and barometric pressure instead of the standard display and indoor unit as the outdoor unit alone is less than 40% of the full price.

junkier
New user
Posts: 1
Joined: 28 Jan 2018, 13:37

Re: Plugin Development

#12 Post by junkier » 28 Jan 2018, 13:45

Is solved the problem P124_Ventus_W266_RFM69 Domoticz wind

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#13 Post by osoon » 23 Mar 2018, 21:18

@JustmeNL
is there any chance to show also Ice / frost warning and air pressure?

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#14 Post by JustmeNL » 30 Mar 2018, 13:06

@osoon, At this moment we can”t because those sensors are internal to the Displayunit. However you could just add a bmp180 which is also supported by easyesp.

I wrote this to use with my Domoticz setup and Domoticz does not support ice warnings. You could add rules to check the temprature and send ice warnings to your setup.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#15 Post by osoon » 17 Apr 2018, 00:11

JustmeNL wrote: 30 Mar 2018, 13:06 @osoon, At this moment we can”t because those sensors are internal to the Displayunit. However you could just add a bmp180 which is also supported by easyesp.

I wrote this to use with my Domoticz setup and Domoticz does not support ice warnings. You could add rules to check the temprature and send ice warnings to your setup.
thanx.
ive been using it now for 2-3 weeks and i have to admit there might be a bug.
in espeasy:

Plugin function:
Value 1: Rain in mm per hour
Value 2: Total rain in mm
Value 3: not used

rain per hour stays stabile 0 all the time and displayunit shows not per hour but "per day", "weekly" and "total"... how is possible that espeasy should show per hour at all?

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#16 Post by JustmeNL » 17 Apr 2018, 07:50

@osoon I wrote, and tested, my plugin for Domoticz. Domoticz expects the rain per hour in mm value: https://www.domoticz.com/wiki/Domoticz_ ... L%27s#Rain

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#17 Post by osoon » 17 Apr 2018, 10:45

JustmeNL wrote: 17 Apr 2018, 07:50 @osoon I wrote, and tested, my plugin for Domoticz. Domoticz expects the rain per hour in mm value: https://www.domoticz.com/wiki/Domoticz_ ... L%27s#Rain
correct me if im wrong... espeasy should give some value despite it for domoticz or whatever, no? i have stable zero, but total rising :)
rain.jpg
rain.jpg (49.64 KiB) Viewed 22359 times

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#18 Post by osoon » 22 Apr 2018, 12:22

@JustmeNL can you confirm there might be a bug?

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#19 Post by JustmeNL » 22 Apr 2018, 22:29

It shows the current rain in mm/hr. So it refreshes every 5 minutes or so. If you want to know the rain in the last hour you can use the total rain counter.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#20 Post by osoon » 24 Apr 2018, 12:58

JustmeNL wrote: 22 Apr 2018, 22:29 It shows the current rain in mm/hr. So it refreshes every 5 minutes or so.
are you sure?
please take a look. its raining outside here right now.

13.39
1339.png
1339.png (77.44 KiB) Viewed 22218 times
13.43
1343.png
1343.png (81.74 KiB) Viewed 22218 times
13.51
1351.png
1351.png (98.93 KiB) Viewed 22220 times
and homeassistant shows 13.51 that rain per hour was last updated 2 hours ago, its time when i restarted it.
ha1353.png
ha1353.png (50.81 KiB) Viewed 22218 times
i cant see any updates every 5 minutes....
any comments?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin Development

#21 Post by TD-er » 24 Apr 2018, 22:16

You have a lot of this plugin activated and all on GPIO pin 0.
At first, do not use GPIO pin 0 for any plugin, unless you really know what you're doing.
Second. The plugin is not setup, I guess
Third, I am not sure this plugin will work well when used multiple times on the same ESP node. Not many plugins can work with more than one of the same active.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#22 Post by osoon » 24 Apr 2018, 22:54

TD-er wrote: 24 Apr 2018, 22:16 You have a lot of this plugin activated and all on GPIO pin 0.
At first, do not use GPIO pin 0 for any plugin, unless you really know what you're doing.
quick guess: you havent set up this weatherestation, right? i would appreciate help from people who knows. thank you.
regarding gpio0: i have no possibility to choose any pins.

edit: take a look https://www.letscontrolit.com/wiki/index.php/VentusW266

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Plugin Development

#23 Post by TD-er » 24 Apr 2018, 23:42

osoon wrote: 24 Apr 2018, 22:54
TD-er wrote: 24 Apr 2018, 22:16 You have a lot of this plugin activated and all on GPIO pin 0.
At first, do not use GPIO pin 0 for any plugin, unless you really know what you're doing.
quick guess: you havent set up this weatherestation, right? i would appreciate help from people who knows. thank you.
regarding gpio0: i have no possibility to choose any pins.

edit: take a look https://www.letscontrolit.com/wiki/index.php/VentusW266
Ah I see, indeed. Sorry about the confusion.

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#24 Post by JustmeNL » 27 Apr 2018, 12:25

@osoon, You might be correct, this can't be right. Let me check the code. If this has a bug then probably the lightning strikes are also wrong.

I'll have to find the time though, so don't expect the fix in the next few days but should not take very long to fix.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#25 Post by osoon » 27 Apr 2018, 16:31

JustmeNL wrote: 27 Apr 2018, 12:25 @osoon, You might be correct, this can't be right. Let me check the code. If this has a bug then probably the lightning strikes are also wrong.

I'll have to find the time though, so don't expect the fix in the next few days but should not take very long to fix.
thank you! :)

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#26 Post by JustmeNL » 01 May 2018, 09:43

Ok, as far as I can tell it does show the current rainfall but due to a rounding error it”ll only show rainfall in excess of 12 mm/hr.

I still have to write the fix and test it out though. Also lightning can do with a rewrite sincce distance seems to work fine but lightning strikes per 5 min. also only ever shows 0.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#27 Post by osoon » 02 Jun 2018, 10:33

JustmeNL wrote: 01 May 2018, 09:43 Ok, as far as I can tell it does show the current rainfall but due to a rounding error it”ll only show rainfall in excess of 12 mm/hr.

I still have to write the fix and test it out though. Also lightning can do with a rewrite sincce distance seems to work fine but lightning strikes per 5 min. also only ever shows 0.
do you have been time do look at this?
found another issue... we had last night light wain and my internal unit shows total 0,7 mm but plugin stays at zero...

JustmeNL
Normal user
Posts: 26
Joined: 09 Dec 2016, 23:10

Re: Plugin Development

#28 Post by JustmeNL » 13 Jun 2018, 14:57

Hi,

I created a fix but I'm still in the process of testing. You could try it out: https://github.com/JustMe-NL/ESPEasy
If you do try this one please let me know if this fixed the problems.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#29 Post by osoon » 05 Jul 2018, 19:25

JustmeNL wrote: 13 Jun 2018, 14:57 Hi,

I created a fix but I'm still in the process of testing. You could try it out: https://github.com/JustMe-NL/ESPEasy
If you do try this one please let me know if this fixed the problems.
seems no change, total updating but per hour still not.

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#30 Post by osoon » 20 Aug 2018, 19:54

JustmeNL wrote: 13 Jun 2018, 14:57 Hi,

I created a fix but I'm still in the process of testing. You could try it out: https://github.com/JustMe-NL/ESPEasy
If you do try this one please let me know if this fixed the problems.
any updates maybe

osoon
Normal user
Posts: 15
Joined: 22 Mar 2018, 21:07

Re: Plugin Development

#31 Post by osoon » 03 Apr 2019, 00:55

JustmeNL wrote: 13 Jun 2018, 14:57 Hi,

I created a fix but I'm still in the process of testing. You could try it out: https://github.com/JustMe-NL/ESPEasy
If you do try this one please let me know if this fixed the problems.
have you been time to look at this maybe?

Vincenttor
New user
Posts: 9
Joined: 15 Jan 2020, 19:56
Location: Netherlands
Contact:

Re: Plugin Development

#32 Post by Vincenttor » 15 Jan 2020, 19:59

Its an old topic, i know.
But like someone else asked in the beginning, is this working with mqtt ?
As i am not using domoticz this would be great.
thanks

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 36 guests