Schneider Electric Wiser Forum
Connect with Wiser Smart Home solution experts in the Schneider Electric Wiser forum. Discuss tips on features, updates, installation, and how to get the most out of your Wiser products.
User | Count |
---|---|
25 | |
12 | |
10 | |
5 |
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-28 07:50 AM
Firstly, I don't see any posts on this forum for the Drayton Wiser Heat Control API, and the only ones I can find anywhere are for Home Assistant, so I'll let the admins decide if there should be an API sub forum here, or leave it in with Apps/somewhere else.
Anyway, here's a little starter for anyone that would like to have a dabble:-
The API(s) have been written using Python, which I am unfamiliar with, but they make sense and can be viewed and run in my familiar environment of Microsoft Visual Studio.
The latest API and instructions can be downloaded here:- https://pypi.org/project/wiserHeatAPIv2/
The instructions are good BUT it instructs you to put your hub IP address and Secret Key in a parameter
file:-
Create a file called params.py and place two lines, one with the wiser IP or hostname and the other with the secret key. e.g.
HOST=192.168.0.22 KEY=ABCDCDCDCCCDCDC
I did this and got an error when trying to run the test code, and after hours of messing about with it I tried putting the values in quotes and it works! It could be that this is version/OS specific but it had me going for a while:-
HOST="192.168.0.22"
KEY="ABCDCDCDCCCDCDC"
So, there's your starter
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-28 09:04 AM
I believe the API would be classed as a REST API in modern parlance. (Or an ill-defined 'bag-of-bits', to an old-timer like me 😛 )
There's some example code in Python and some in C# on Github. Personally, I just use Curl (included with Windows these days).
There are some more titbits of information in this thead (5th post).
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-28 02:44 PM
I am familiar with CURL, but haven't seen a reference for accessing the Wiser heat system, do you have a link please?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-28 04:43 PM
There's no documentation on the API itself, other than that linked to in the post above (and other's that subsequently built upon it). I've not seen anyone else use Curl, but I included a couple of simple examples in that post. (I've just edited, to make a little clearer.)
A combination of Curl and 'Dos batch files' (or whatever their official name is these days), was sufficient to knock together some custom sensors for PRTG, which is my monitoring system of choice.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-28 11:08 PM . Last Modified: 2022-12-28 11:18 PM
I used to be quite a dab hand with DOS batch files and still use them, in fact I delivered a presentation about it at a job interview! I didn't get the job 😁.
This is just a hobby for me, to keep my brain active, and I would like to incorporate iit nto a Visual Studio VB.Net project that I use to display information in a form and run as a scheduled task to update a spreadsheet with info from my smart meters and Switchbot temperature sensors. That uses Http requests, which returns JSON, which I disseminate.
I resorted to a batch file with this as the Python code prints the results in a window and disappears.
I have run the V2 python API example, which returns all of the properties and methods, which I haven't looked at in detail yet. Did you get that far, or manage to find all of the endpoints, and if not would this be of use to you?
We could continue this conversation outside of here if you think it's more appropriate, but it may be useful for others?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-29 12:09 PM
@DaveP wrote:
I have run the V2 python API example, which returns all of the properties and methods, which I haven't looked at in detail yet. Did you get that far, or manage to find all of the endpoints, and if not would this be of use to you?
I've not looked in detail at any of the code on Github - I've been able to do everything I wanted to do (so far), using either Julian Knight's documentation, or stuff I've reverse-engineered myself.
The next step for me, is to build some ESP8266-based hardware to add some functionality. For example, I want to be able to press one button to tell it to switch off all the downstairs - or to select the no. of hours it should be in "away mode". The main challenge is in getting the little boxes to look 'pretty' and be able to run on battery power.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-29 02:27 PM
The nice thing about running the V2 API test is that it picks up all properties and methods, so would be dynamic if they change.
I don't understand why you need hardware to do what you want, or is it more you want hardware to do it?
I've done a bit with Arduino and Bluetooth, stepper motors and an Android app to make a tripod pan/tilt head
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-29 03:45 PM . Last Modified: 2022-12-29 06:03 PM
@DaveP wrote:The nice thing about running the V2 API test is that it picks up all properties and methods, so would be dynamic if they change.
I had a bit of a play with WiserHeatAPI (API to the Wiser API 🙂 ). Reading through the code, it looks like it has quite a lot of functionality - but unfortunately not for me 🙁 ... the instructions refer to files I don't have; I can't get any of the Python files to do anything in isolation. A project for a rainy day in 2023 maybe.
@DaveP wrote:
I don't understand why you need hardware to do what you want, or is it more you want hardware to do it?
When I disappear to the 2nd floor, I usually hit the "Boost downwards" switch on five of the radiators on the ground floor - or I can use the app which takes even longer.
When I go out for the day, I have to go to the 2nd floor, wake up my PC (no longer on 24x7, due to energy costs) and run my script - just to say how long I want "Away Mode" to last.
I started thinking that a simple dedicated hardware box was the answer - ESP8266 running C++, talking to the Heat Hubᴿ. There's a bit of mission creep though - wouldn't it be nice to have a full colour touch screen interface? - to give Wiser the user interface it never had 😁
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-29 10:55 PM
I hadn't tried using the individual files yet.
To me, the obvious piece of hardware is your mobile, so I looked at running CURL from Android, which I assumed you use?
Apparently not supported BUT the first response to a question was to use HTTP requests, which is exactly what I do in my .Net project for smart meter and thermostats. The real issue is that Drayton have not published the endpoint calls and returns, and allow the user to determine how they implement that in their language of choice. A few individuals have done that and produced their own code, which is offered as the API.
So I started thinking about a mobile app, which I've created before using MIT App Inventor on Windows (give it a look, I think you'll like it), and then thought why are we talking about a mobile app when it should be in the Wiser app?
Having a very brief play, why can't you achieve what you want with Moments in the Automation? It looks like you can select any/all of your devices and set a temperature, give it a name and save it?
We seem to have an overlap of skills and mindset.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-30 04:55 PM
@DaveP wrote:
Having a very brief play, why can't you achieve what you want with Moments in the Automation? It looks like you can select any/all of your devices and set a temperature, give it a name and save it?
"Moments" are a step forward, but you can't specify for 'how long' you want them to apply - the temperature is changed until the next scheduled event.
Looking at the data that is returned about a 'moment' created by the app:-
{"Domain":"Room","Id":1,"Action":"RequestOverride","Value":"{\"type\":\"Manual\",\"setPoint\":213}"}
There's no time parameter in the definition. (Incidentally, in that example I have 21.3°C defined as the temperature - and it doesn't work (even though it does in a scheduled event)).
I tried to manually create a moment that is a 'boost', rather than just a temperature change. The Hubᴿ accepts (and stores it) ... but it doesn't work (just silently fails).
{"Domain":"Room","Id":1,"Action":"RequestOverride","Value":"{\"durationMinutes\":30,\"type\":\"Boost\",\"setPoint\":215}"}
At this point, I remembered that it is possible to store corrupt data in the Hubᴿ that stops the app working (an earlier version of the app stored "24:00" as a time in a schedule - and a later version exploded and died when it saw it 🙄 ). I've ceased and desisted (for a while anyway!).
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-12-30 11:16 PM
Away Mode?
If not, then there should be an option to achieve what you want, but it looks like you've investigated them all.
Moments is really only good for a moment then 😁
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-02 05:16 AM
Even if you use it only for controlling Wiser, one option to consider would be a raspberry pi (anything from a 2b on) running Home Assistant and the wiser integration. From there you can do anything your heart desires using automations or even NodeRED. To give you an idea of the level of flexibility in the automation, you could easily extract, modify and replace entire schedules based on almost any conceivable trigger, so setting the period for "away" is trivial.
I have mine set up to put the system into away mode when:
1)all the inhabitants have left the house
2) an NFC tag on the front door is scanned (overrides 1 in case my daughter leaves her phone behind or something)
it comes out of away when any of the following happen:
1) I go from being "At Work" to "Away"
2) my daughter goes from "At school" to " away"
3) my wife goes from "At Work" to "Away" and then it waits until she is "At the station"
4) the front door is unlocked
Setting a time limit for away is also very straightforward, you could have a simple input variable for the length of away, and set a button trigger to put wiser into away mode, wait for that input variable's time, then unset away. Or have buttons for set times, or any other way you want to do it. It really is limited more by imagination than anything else!
You mentioned a UI - easy peasy with HA as the UI is a web page (or an android app that adds a lot of other useful functionality) so can be shown on pretty much any connected device with a screen.
If you are capable of writing code for an ESP module for this then home assistant on a pi will be within your abilities, and does everything you can think of (plus a lot more)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-02 04:28 PM
@Gronod wrote:Even if you use it only for controlling Wiser, one option to consider would be a raspberry pi (anything from a 2b on) running Home Assistant and the wiser integration.
Yes - I can't argue with that - it's just that me and Raspberry Pi never really hit it off. (Well me and linux to be precise!). My introduction to all things unix started in 1987 when suddenly VAX/VMS dropped out of fashion. I thought I might need to find a completely new career, but fortunately all the guys from DEC went to work for Microsoft and saved the day 😁 (Thank you god, for sending Dave Cutler to save us in the hour of our greatest need).
If you are capable of writing code for an ESP module for this then home assistant on a pi will be within your abilities
You haven't seen my style of C++ coding!
On Page 65 of this book , Kernighan and Ritchie granted C a 'goto' statement ... and I'm not afraid to use it. 😁
But since I seem to have at least three Raspberry Pi's in my possession, maybe 2023 will be the year I find a serious use for them.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-02 10:56 PM . Last Modified: 2023-01-02 10:58 PM
I have been emailed, probably automated, asking me to choose a reply as an accepted solution.
It's been great interacting on this, but I believe the truth of it is that Drayton do not provide adequate documentation.
It seems that the current functionality in the spp needs improving so that we don't have to creat our own solutions for controlling the system?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-02 11:05 PM
Would you believe that my early days were spent on DMRS on a DEC VAX Intergraph badged CAD system on a job for Eastern Electricity. That moved to a Clipper based Unix platform, and then thankfully to PC.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-03 01:04 PM
I said capable, not safe! 😂
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-16 06:11 AM
Just use Home Assistant and the Wiser integration. No need to build your own hardware.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-16 03:16 PM
I will have a(nother) look at Home Assistant (since there now seem to be WSL and Hyper-V solutions). However, I still want some kind of simple, dedicated hardware interface. A Raspberry Pi stuck to the wall is not quite what I have in mind 😛.
I'm hoping HA might help with scheduling - the App in its current incarnation is fairly unusable with my configuration; I'm editing JSON files with notepad or loading sets I 'prepared earlier' ☹️
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-01-18 02:48 AM . Last Modified: 2023-01-18 02:50 AM
You can create a dashboard in Home Assistant and mount a cheap tablet to the wall for your interface. See partial screenshot of my dashboard attached. The Wiser integration has it's own scheduling card, which makes changing schedules a breeze.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.