Stokerforum

Interface => Interface til varme systemer => Emne startet af: TRK efter Apr 19, 2015, 20:46

Titel: Integration med ifttt.com
Indlæg af: TRK efter Apr 19, 2015, 20:46
Hej

Kunne det ikke være fedt at koble IFTTT sammen med ens pillefyr, så man kunne styre fyret via IFTTT.
Et par eksempler kunne være

Link til IFTTT's about side: https://ifttt.com/wtf
Link til formular omkring oprettelse af ny channel: https://docs.google.com/forms/d/1dlH6aA2nXQ4EWfQbxHKueHvfyulFPmInkjk7PabUxF8/viewform
Titel: Sv: Integration med ifttt.com
Indlæg af: g82 efter Feb 27, 2016, 08:49
Man kan også bruge den "nye" Maker channel, dette kræver ikke at man bliver godkendt til en rigtig channel.

Man sender events som en webhook til ifttt, og modtager events på samme måde den anden vej.

Men indtil/hvis der kommer support direkte fra stokercloud kan man hente stokercloud data ud via api og selv lave de kald der skal til :)
Titel: Sv: Integration med ifttt.com
Indlæg af: TRK efter Mar 02, 2016, 12:36
Den skal jeg helt sikkert kigge nærmere på. Tak for råd.
Fik du UDP til at virke på din styring? Jeg kan simpelthen ikke få hul igennem, både med python test scriptet og noget selvkodet PHP.
Koder nu lidt mod JSON outputtet, men det ville jo være lidt mere spændende at have hul igennem til hele styringen.
Titel: Sv: Integration med ifttt.com
Indlæg af: g82 efter Mar 02, 2016, 12:45
Fik ikke rigtig UDP til at virke, det kører et par dage efter jeg genstarter fyret inden det dør :(

Jeg har i over et år hentet data fra json export siden, men der er ikke de nye parametre såsom PI-regulering.

Bruger det her til at få json data i et lidt nemmere format
Kode: [Vælg]
$json = file_get_contents("http://stokercloud.dk/dev/getdriftjson.php?mac=g82");
$data = json_decode($json);
$temps = $data->jsondata[1]->{2};
$o["Frem"] = $temps[0]->{0};
$o["Retur"] = $temps[4]->{4};
$o["Skakt"] = $temps[1]->{1};
$o["Roeg"] = round($temps[2]->{2});
$o["Target"] = round($temps[3]->{3});

$s = $data->jsondata[2]->{4};
$o["Ydelse"] = round($s[0]->{0});
$o["Ydelsekw"] = $s[1]->{1};
$o["Status"] = $s[7]->{11};
$o["Ilt"] = round($s[2]->{2});
$o["Lys"] = $s[3]->{3};
$o["Magasin"] = $s[5]->{5};

var_dump($o);
Titel: Sv: Integration med ifttt.com
Indlæg af: motoz efter Mar 02, 2016, 13:06
Citér
Jeg kan simpelthen ikke få hul igennem, både med python test scriptet og noget selvkodet PHP.
What firmware version are you running? It should work from 7.0612 to 7.0627.  (But at least on 7.0612 the controller needs to be reset every now and then to keep working). From 7.0629 and up the protocol has some changes (eg the password is encrypted to add some security), I have not yet pushed the changes to make it work with the new protocol.
Titel: Sv: Integration med ifttt.com
Indlæg af: g82 efter Mar 02, 2016, 13:19
For referrence I am on v7.0627 and needs resetting every few days.
Titel: Sv: Integration med ifttt.com
Indlæg af: motoz efter Mar 02, 2016, 13:41
I had the impression that the instability problems were solved so Jens would probably like to hear about that,  like what data you are reading and how often, ie. how to reproduce the error.

My V7 box is still not connected to the burner and only sporadically used when I have some spare time to tinker with it so I have not noticed.
Titel: Sv: Integration med ifttt.com
Indlæg af: motoz efter Mar 07, 2016, 08:00
I left the controller running 5 days ago with the python client continuously reading all operating data every second, still no signs of any problem. Fw version 7.0631.
Titel: Sv: Integration med ifttt.com
Indlæg af: TRK efter Mar 08, 2016, 20:38
Hmmm, I believe I have found my problem.
I have configured my router to give the control box a static ip address by binding it to the MAC address.
What I'm seeing however, is that the MAC address has changed.

The last 6 characters are the same, but the first 6 changes.
Can anyone confirm this?

Example: yy-yy-yy-xx-xx-xx changes to zz-zz-zz-xx-xx-xx

So in the end it turns out the control box has requested a DHCP IP and received another than the one I thought I had configured.
Titel: Sv: Integration med ifttt.com
Indlæg af: TRK efter Mar 08, 2016, 21:18
If anyone is interested, please find attached a php script for checking boiler through StokerCloud JSON and report warning or critical through the maker channel on IFTTT.

Edit: Updated script
Edit 2: Use of the attached script is on your own responsibility, it has not been fully tested.
Titel: Sv: Integration med ifttt.com
Indlæg af: motoz efter Mar 09, 2016, 06:38
Nice, that works fine:
Kode: [Vælg]
php stokercloud_json_web.php
Date/Time: 2016-03-09 08:29:00
Boiler: 73.1
shaft: 48.0
Smoke: 145.0
Return: 48.0
Utilization: 41.0
KW: 8.3
Lux: 99
O2 actual: 13.4
O2 target: 13.5
Hopper: 1254
Status: Critical

Maybe you could edit your first post and add the script there so it's easier to find later?

The changing mac seems strange... Anyway the controller listens for broadcast discovery messages so you can just omit the address from the command line then the client will find the controller automatically as long as you are on the same network as the controller.