Project

General

Profile

Feature #159

Youless support

Added by PixelMagic almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/17/2012
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Just got Domotiga, very impressive !

Got it running on a Raspberry Pi, got no other supported hardware yet, only got a Youless powermeter. Would love to read it and use the data in Domotiga. It has a web interface that can display data with JSON.

Any chance there will be a module for the Youless made ?

Can help with data, am familiar with php/mysql but not al all with Gambas (yet!)

History

#1 Updated by rdnzl over 6 years ago

  • Status changed from New to In Progress

Can code it.
Any data/example scripts or documents are welcome.

But you can also write some php scripts to fetch the data and use it with Shell type device, like described here.

http://domotiga.nl/projects/domotiga/wiki/Shell

If you make sure the values are echoed on separate lines on the command line, and script is executable, domotiga will use them as device values.

#2 Updated by DJP over 6 years ago

Hello, I'm very intrested to in this new feature. But I have almost no experience with Domotiga (just start working with it à few days ago)

On gathering.tweakers.net is a topic regarding the youless. In This topic are some ready to scripts programmed in php of i'm correct.

If i can help/test anything juist let me know.

#3 Updated by PixelMagic over 6 years ago

rdnzl wrote:

Can code it.
Any data/example scripts or documents are welcome.

Got two small shell-scripst, but real intergration would be nicer.

Script one for getting current Kwh usage:

#/bin/bash
wget http://192.168.1.11/a -q -O - |grep kWh|sed s/\ kWh//|sed s/\,/\./|sed s/^\ //

Script two, returns the current count of the meter:

#/bin/bash
wget http://192.168.1.11/a -q -O - |grep Watt|sed s/\ Watt//|sed s/\,/\./|sed s/^\ //

The youless itself has a small webserver that can return JSON data, calling this

http://192.168.1.11/a?f=j

will return:
{"cnt":"41619,573","pwr":220,"lvl":0,"dev":"","det":"","con":"*","sts":"","raw":0}

Historical data is also available, but need to be read once an hour or so:
1 minute resolution
url = http://192.168.1.11/V?h=1
h = 1 for the interval now till 30 minutes ago.
h = 2 for the interval 30 till 60 minutes ago.

http://192.168.1.11/V?h=1&f=j

will return the first 30 minutes like this:
{"un":"Watt","tm":"2012-07-26T16:09:00","dt":60,"val":["  246","  366","  342","  336","  336","  336","  342","  342","  342","  342","  342","  342","  336","  342","  426","  354","  354","  438","  426","  408","  354","  354","  318","  312","  216","  216","  216","  216","  216","  216",null]}

From td-er's site:
This sample (output without newlines) contains the following information:

    unit: kWh
    start time: 2012-01-01T00:00:00
    delta time (time between samples): 86400 seconds (1 day)
    an array with values for each (recorded) day (array is null-terminated)

For more info check[[http://wiki.td-er.nl/index.php?title=YouLess] (error 500 atm).

If needed i can provide temp acces to my Youless for you, contact me if needed please.

#4 Updated by Tommmii over 6 years ago

If needed I will offer access to my youless also!

#5 Updated by rdnzl over 6 years ago

Kind of forgot this feature request, I will start adding it, once done I will accept the offer to get access...

#6 Updated by rdnzl over 6 years ago

2012/11/12 20:51:10 [YouLess] Fetching 'http://localhost/index.html'
2012/11/12 20:51:10 [YouLess] Received '{"cnt":"4457,005","pwr":453,"lvl":0,"dev":"","det":"","con":"OK","sts":"(52)","raw":0}'
2012/11/12 20:51:10 [YouLess] Counter: 4457.005 kWh
2012/11/12 20:51:10 [YouLess] Usage: 453 Watt
2012/11/12 20:51:10 [YouLess] Status: OK

Got data parsing working from a local fake page, a YouLess contains no address or unique string so it seems, only one device supported is Ok?
I guess people using more than one YouLess are rare...

#7 Updated by Tommmii over 6 years ago

you're right;
  • the Youless doesn't identify itself,
  • >1 Youlesses would be a rare occurrence.

#8 Updated by rdnzl over 6 years ago

I just commited version 1.0.002 (r1028) with YouLess support, please test it, wiki page has to be written, I created an empty one, maybe someone can put some info together.

#9 Updated by DJP over 6 years ago

I updated the software and created a Youless device. i got the following errors :

2012/11/15 21:33:17 [YouLess] Received wrong formatted JSON data!
2012/11/15 21:33:27 [YouLess] Fetching 'http://192.168.1.51/a?f=j'
2012/11/15 21:33:27 [YouLess] Received '{"cnt":"97957,114","pwr":619,"lvl":38,"dev":"(±3%)","det":"","con":"OK","sts":"(13)","raw":295}'
2012/11/15 21:33:27 [YouLess] Received wrong formatted JSON data!
2012/11/15 21:33:37 [YouLess] Fetching 'http://192.168.1.51/a?f=j'
2012/11/15 21:33:37 [YouLess] Received '{"cnt":"97957,116","pwr":620,"lvl":38,"dev":"(±3%)","det":"","con":"OK","sts":"(03)","raw":359}'
2012/11/15 21:33:37 [YouLess] Received wrong formatted JSON data!
2012/11/15 21:33:47 [YouLess] Fetching 'http://192.168.1.51/a?f=j'
2012/11/15 21:33:47 [YouLess] Received '{"cnt":"97957,116","pwr":620,"lvl":39,"dev":"(±3%)","det":"","con":"OK","sts":"(53)","raw":332}'

#10 Updated by rdnzl over 6 years ago

It seems JSON.Decode doesn't count empty fields, I made it more flexible now.
Can you try the last revision?
Thanks for reporting.

#11 Updated by DJP over 6 years ago

For me its working now thank you very much!

#12 Updated by DJP over 6 years ago

Is it possible to make a special 'Youless' block for the Home page, just like the Power Usage block only with value's from the Youless?

#13 Updated by DJP over 6 years ago

Never mind I solved it, before the official Youless support i got a shell device created what did the same, onlye the value1 and value2 were switched. with the new Youless support the Power Usage block works fine!

#14 Updated by rdnzl over 6 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF