Toon app: WPBController

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

Post Reply
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Toon app: WPBController

Post by glsf91 »

Normally you can program a Domestic Hot Water heatpump (Dutch : WPB) when to heat the water in the boiler when it is below a specific temperature. I have a WPB Atlantic Explorer V4 which also has a PV contact. That means you can switch on the boiler when activating the contact, regardless of the running program. It intended use is to switch on the WPB when there is enough power from your solar panels.

You have to add a wifi device with for example a relay to open and close the contact. In my case I use an esp8266 with ESPeasy on it. I have connected a temperature sensor for the boiler temperature and a relay for the PV contact. With ESPeasy I can request the temperature and I can switch on and off the relay with http URL's.
You can also use other solutions. Most important is that you can use http(s) calls to get the temperature and switch on/off the PV contact.
The URL's for getting the temperature and switch on and off should be a GET request and parameters are allowed (no body). The response from the URL for the temperature must have a body where the temperature can be determined using a regular expression.

The app has the following functionality:
- get the temperature from the WPB
- manual switch on or off the PV contact
- automatic switch on or off the PV contact based on the temperature
- only automatic switch on the PV contact based on the temperature
- only automatic switch off the PV contact based on the temperature
- refresh temperature

It does not read the status of the PV contact or WPB itself.

You can change the following settings:
- URL to get WPB temperature (see below)
- URL to switch on the PV contact (see below)
- URL to switch off the PV contact (see below)
- regular expression the get the temperature from the response of the URL used to get the temperature (see below)
- refresh interval in minutes for polling the temperature
- enable or disable WPB controller (disable: only manual control is possible, temperature is not polled anymore)
- enable or disable icon in systray

You can also test the temperature regular expression on the settings screen with the buttons at the bottom of the screen.

The tile shows the WPB temperature and the status off the last command. When clicking on the Tile you get a screen:
wpbcontroller_screenshot_2.png
wpbcontroller_screenshot_2.png (44.53 KiB) Viewed 2094 times
Here you can:
- go to the settings
- refresh the WPB temperature
- manual switch on the WPB
- manual switch off the WPB
- enable/disable automatic switch on WPB when WPB temperature is below a specific temperature
- enable/disable automatic switch off WPB when WPB temperature has reached a specific temperature
(last 2 only visible when WPB controller is enabled)

The screens shows also the status (time, temperature and action) of the last few actions performed. Remember: it shows the action taken and not the current status of the WPB.
There is also a refresh button to get the WPB temperature on request.

There must be a difference of 5 degrees between the adjustable automatic on and off temperature.
Automatic switching WPB off will only occur when the WPB temperature has been 2 degrees or lower below the configured WPB off temperature.
Automatic switching WPB on will only occur when the WPB temperature has been above the configured WPB on temperature.
The settings and rules will become active after leaving the screen!

Regular expression
The regular expression will be used the get the temperature from the response (mostly JSON). You can find the last response in /tmp/wpbcontroller-response1.txt or on the settings screen using the buttons at the bottom.
You can use https://regex101.com/ with your response to create and test your regular expression. Use the response from the file and not from your browser because sometimes the browser add spaces which are not there.
It is important that only the numeric value (decimal point allowed) is captured. The numerical value must be captured in the first capture group. See examples below.


Example URL's when using Domoticz temperature device and switch device:

Code: Select all

Temperature: http://<ipaddress domoticz>:8080/json.htm?type=devices&rid=<idx>
Switch device on: http://<ipaddress domoticz>:8080/json.htm?type=command&param=switchlight&idx=<idx>&switchcmd=On
Switch device off: http://<ipaddress domoticz>:8080/json.htm?type=command&param=switchlight&idx=<idx>&switchcmd=Off
Replace <idx> with the device id used.

Example URL's when using ESPeasy temperature device and switch device:

Code: Select all

Temperature: http://<ipaddress espeasy>/json?tasknr=<task id>&view=sensorupdate
Switch device on: http://<ipaddress espeasy>/control?cmd=event,TurnOn
Switch device off: http://<ipaddress espeasy>/control?cmd=event,TurnOff
Replace <task id> with the task id of the temperature sensor.

For switching the device in ESPeasy you must have some rules in place:

Code: Select all

On TurnOn do
  gpio,4,1   // switch on relay on GPIO 4
EndOn
On TurnOff do
  gpio,4,0   // switch off relay on GPIO 4
EndOn
Example regular expression domoticz:

Code: Select all

Expression:   .*\"Temp\" : (.*?),

Example part of response:
                        "SubType" : "LaCrosse TX3",
                        "Temp" : 53.859999999999999,
                        "Timers" : "false",
                        "Type" : "Temp",
Example regular expression ESPeasy:

Code: Select all

Expression:  .*Value\":([0-9.]*)

Example response:
{
"TaskValues": [
{"ValueNumber":1,
"Name":"Temperature",
"NrDecimals":2,
"Value":55.17
}],
"TTL":60000,
"TaskEnabled":"true",
"TaskNumber":2
}
You can find the response of the switch on and off URL in /tmp/wpbcontroller-response-WPBOff.txt and /tmp/wpbcontroller-response-WPBOn.txt. This can be helpful when switching on/off is not working.

V1.0.0
-Initial release


Known issues
Empty thumbnail icon when adding to Tile. Has no influence on app functionality. It will be fixed in an upcoming resource file update.
Post Reply

Return to “Toon Apps”