# Youless connection (LS120S0) homey through prometheus in grafana

**URL:** <https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336>\
**Category:** Questions & Help\
**Tags:** app\
**Created:** [November 22, 2018, 3:35pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336 "2018-11-22T15:35:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 3:35pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/1 "2018-11-22T15:35:54Z")

</div>

Hello  
I’m trying to connect the measurements of a LS120 (youless) not the P1 connect but the S0 connection as a command string in prometheus.

It works with the code LS120P1:  
homey\_device\_meter\_power{device=“1202f494-c55d-4b64-8ce8-e4031d832d7d”,instance=“192.168.0.159:9414”,job=“homey”,name=“LS120P1@72:b7:ad:14:31:54”,zone=“Thuis”,zones=“Thuis”}

So i’ve tried to change the code P1 into S0:  
homey\_device\_meter\_power{device=“1202f494-c55d-4b64-8ce8-e4031d832d7d”,instance=“192.168.0.159:9414”,job=“homey”,name=“_ **LS120S0** _@72:b7:ad:14:31:54”,zone=“Thuis”,zones=“Thuis”}

unfortunately it does not work, can anyone help me with the code, how can i get the measurements for the S0 contact. (In homey I can See the values)

Please let me know

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 3:43pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/2 "2018-11-22T15:43:30Z")

</div>

The s0 interface on the ls120 is fully supported through the youless app. Why dont you use that?

[https://apps.athom.com/app/nl.maikvanwel.youless](https://apps.athom.com/app/nl.maikvanwel.youless)

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 4:01pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/3 "2018-11-22T16:01:57Z")

</div>

Hello Robin,  
I’m using LS120 through the youless app, but i want to connect the S0 signal with prometheus i/o app to prometheus and into grafana, where i’m making my own dashboard.  
The P1 signals works correct, only the S0 i can’t make the connection. I’m not sure where the signals are defined, certenly in the homey, but how is it connect to prometheus io ?  
Please let me know

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 4:15pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/4 "2018-11-22T16:15:47Z")

</div>

You are in luck my friend LOL

I made a node package just for people like you. It will let you read and set the youless, including the s0. I’m using it myself for the Homey Enelogic and Youless apps.

Find it here: [https://www.npmjs.com/package/youless](https://www.npmjs.com/package/youless)

Developer documentation here: [https://gruijter.github.io/youless.js/](https://gruijter.github.io/youless.js/)

And concerning not being able to connect S0 to the Youless app, you did add the correct device right?  
 ![2018-11-22_LI](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/5/5f2ca7db632a105496ff509dbf2091f143b39158.jpeg)

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 4:41pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/5 "2018-11-22T16:41:05Z")

</div>

Hello Robin,  
Thank you for your information.  
About your question, i’ve used the LS120 S0 app and it works within Homey, not within prometheus.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 4:43pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/6 "2018-11-22T16:43:24Z")

</div>

ok. I checked my code, and the device ID of s0 is indeed `LS120S0@${info.mac}` as you already guessed. But do you not need the Homey instance also? Where did you get the `device=“1202f494-c55d-4b64-8ce8-e4031d832d7d` from?

Edit: I just tried to add a S0 myself, and there might be a bug in my app that makes the id: `LS120S0@undefined`

Give that a try @marc90

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 4:50pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/7 "2018-11-22T16:50:42Z")

</div>

Hello robin,  
i will try and let you know.

Furthermore I’ve just got als an answer of the, I assume the developer of prometheus io " RickardP"

His Reply:

" Basically, the Prometheus exporter exports one power Metric per device, and AFAIK this is how theHomey API works.

I know that some devices with multiple power readings (the Fibaros for example) will present themselves as two devices.

In any case, the Prometheus exporter just exports the data it sees. If you don’t see the data in the Prometheus or Grafana UIs, that means the exporter does not see it either. If this is the case, it may be better to file an issue on the driver project for the device instead."

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 5:40pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/8 "2018-11-22T17:40:00Z")

</div>

Hello Robin,

i’ve tried to connect  
homey\_device\_measure\_power{instance=“192.168.0.159:9414”,job=“homey”,name=“ **LS120P1** @72:b7:ad:14:31:54”,zone=“Thuis”,zones=“Thuis”} without the device code. This works also correct. Probably the device code is generated within prometheus because this in running in a docker on a NAS.

When i rename the **LS120P1** into **LS120S0** is still doesn’t work. My be like you suggested is it a bug ?  
Can you fix this ?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 6:00pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/9 "2018-11-22T18:00:55Z")

</div>

Did you try

`LS120S0@undefined`

In stead of

`LS120S0@72:b7:ad:14:31:54`

.

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 7:15pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/10 "2018-11-22T19:15:27Z")

</div>

I’ve tried to test with LS120S0@undefined, it still doesn’t work.  
any other suggestions ?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 7:33pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/11 "2018-11-22T19:33:29Z")

</div>

Im afraid not. I dont know how the prometheus app works.

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 7:40pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/12 "2018-11-22T19:40:11Z")

</div>

[ With the following metrics string it seems that the TAG “name=LS120S0” cannot be found during the “get” function at the homey. I think it’s not probably in the Youless-app correct addressed.  
Can you check/ fix this?

_Metric string:_  
_homey\_device\_measure\_power{instance=“192.168.0.159:9414”,job=“homey”,name=“LS120S0@72:b8:ad:14:33:34”,zone=“Thuis”,zones=“Thuis”}_

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 7:53pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/13 "2018-11-22T19:53:23Z")

</div>

hi @marc90 Again: I have no clue what the prometheus app is doing. My app has no official api. So whatever prometheus is doing, I have no control over that 🙂

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 22, 2018, 8:16pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/14 "2018-11-22T20:16:30Z")

</div>

Hello Robin,

I understand what you are saying, i’m trying to understand the connection between your great app youless and prometheus. I think prometheus is only getting values by the command " \_Homey\_device\_measure\_power{instance=“192.168.0.159:9414”,job=“homey”,name", only it does not recognize the TAG name LS120S0. I think you’ve probably programmed also the code TAG name LS120P1 which is recognized and does work. Maybe you can check this in the app-code of the youless app.

Is my suggestion clear enough for you ?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 22, 2018, 9:54pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/15 "2018-11-22T21:54:47Z")

</div>

> [@Gruijter](#):
>
> LS120S0@${info.mac}

this is how the name is programmed

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 23, 2018, 8:57am UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/16 "2018-11-23T08:57:15Z")

</div>

Is the P1 value then LS120P1@${info.mac} ?

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 24, 2018, 8:31am UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/17 "2018-11-24T08:31:00Z")

</div>

I have tried to help you by providing as much information as I could, and I can only repeat what I already stated before. But you are asking the wrong person.

You say the youless app is doing what it is suposed to do.So please get in touch with the developer of the prometheus app.

---

<div class="post-metadata">

**Author:** ![marc90](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc90/32/2147_2.png) [@marc90](https://community.homey.app/u/marc90)\
**Post date:** [November 24, 2018, 10:04am UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/18 "2018-11-24T10:04:17Z")

</div>

Hello Robin,

I will take further actions according to your recommendations.  
Furthermore i really appreciate that you’ve helped me

Thanks Marc90

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [November 24, 2018, 10:49am UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/19 "2018-11-24T10:49:10Z")

</div>

👍😘

---

<div class="post-metadata">

**Author:** ![Peter\_12](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_12/32/11046_2.png) [@Peter\_12](https://community.homey.app/u/Peter_12)\
**Post date:** [December 3, 2018, 6:31pm UTC](https://community.homey.app/t/youless-connection-ls120s0-homey-through-prometheus-in-grafana/4336/20 "2018-12-03T18:31:46Z")

</div>

I have firmware 1.4.1-PO.  
De youless is logging my gas meter, but how do i get the values out?  
I stil will be able to send my output to pvoutput.  
Thats why i running this firmware.  
Homey is only showing energie and energiemeter.  
I get this output, but no gas meter output values.

Testing now. Hang on…  
========== STARTING TEST ==========  
Node version: v11.3.0  
Youless package version: 2.1.0  
OS: win32 10.0.17134  
trying to login  
login successful: true  
trying to get info  
{ model: ‘LS120’,  
mac: ‘72:aa:ad:aa:xx:xx’,  
firmware: ‘1.4.1-PO’,  
host: ‘xxx.xxx.xx.xx’ }  
trying to get basic power readings  
{ cnt: ‘-273,802’,  
pwr: 713,  
lvl: 0,  
dev: ‘’,  
det: ‘’,  
con: ‘OK’,  
sts: ‘(209)’,  
cs0: ’ 0,000’,  
ps0: 0,  
raw: 0,  
net: -273.802,  
tm: 1543860958.58 }  
trying to get advanced power readings (LS120-EL only)  
undefined  
Available digital meters:  
{ p1: undefined, gas: undefined, s0: undefined }  
trying to get historic Power log of present month  
undefined  
trying to get historic gas log of present month  
undefined  
trying to get historic S0 log of present month  
undefined  
trying to set the device time  
Error: Not logged in  
at Youless.\_makeRequest (H:\node\_modules\youless\youless.js:536:27)  
at Youless.syncTime (H:\node\_modules\youless\youless.js:470:27)  
at doTest (H:\node\_modules\youless\test\_test.js:87:34)  
at process.internalTickCallback (internal/process/next\_tick.js:77:7)  
Youless {  
password: ‘\*\*\*\*\*’,  
host: ‘xxx.xxx.xxx.xxx’,  
port: 80,  
loggedIn: false,  
cookie: [‘tk=xxxxxx’],  
timeout: 4000,  
info:  
{ model: ‘LS120’,  
mac: ‘72:xx:xx:xx:xx:xx’,  
firmware: ‘1.4.1-PO’,  
host: ‘xxx.xxx.xxx.xxx’ },  
hasMeter: { p1: undefined, gas: undefined, s0: undefined },  
lastResponse: ‘d=20181203&t=19:15&v4=720&n=1’ }
