Youless connection (LS120S0) homey through prometheus in grafana

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

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

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

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

Developer documentation here: 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

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.

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

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."

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 ?

Did you try

LS120S0@undefined

In stead of

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

.

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

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

[ 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”}

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 :slight_smile:

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 ?

this is how the name is programmed

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

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.

Hello Robin,

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

Thanks Marc90

:+1::kissing_heart:

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’ }