Thanks again @alivinco
One thing I cant seem to get is names/alias, the only identifies I get are:
dev_id, dev_type, location_id and topic.
Could I ask you for help to understand how I could get name and/or alias sent to my db and Grafana?
Thanks again @alivinco
One thing I cant seem to get is names/alias, the only identifies I get are:
dev_id, dev_type, location_id and topic.
Could I ask you for help to understand how I could get name and/or alias sent to my db and Grafana?
As of now it’s a bit tricky , ecollector doesn’t export that data into influxdb . But you can export location information through Thingsplex UI and use Grafana Json data source plugin to load the metadata and then somehow merge with measurements … not very straightforward , or just manually lookup id’s.
The next version of ecollector will support Influx2.0 export and will also export location information to influx , that will enable possibility to merge 2 datasets using their flux language.
Also I’m having an idea of dashboard generator , but it’s still and idea .
Another interesting news is that latest grafana supports streaming backend plugins, which means that it should be possible to create realtime dashboards , which currently is not possible.
I have influxdb and grafana up and running👍🏻 But after some time, like 2-3 hours i get “LOST_CONNECTION” in ecollector, and have to restart influxdb to get status “RUNNING” again. Grafana have contact with influxdb when this happens, so it seems like influxdb is running fine.
Do you have an idea what could cause this @alivinco ?
Is it possible to export variable values to the InfluxDB?
Usecase: I want to export the price level and price from Tibber to my Grafana dashboard and I already have that as a variable inside of Thingsplex.
Yes, it is possible. Ecollecor has api for writing custom data points, I will share examples tomorrow. Also, there will be a new node for writing historical data into InfluxDB and it’s already available as API for more advanced scripting - Tools - docs (the version is not publicly available yet)
The message that should be used to write measurements into Influx :
Topic : pt:j1/mt:cmd/rt:app/rn:ecollector/ad:1
{
"serv": "ecollector",
"type": "cmd.tsdb.write_data_points",
"val_t": "object",
"val": {
"proc_id": 1,
"bucket": "gen_default",
"dp": [
{
"name": "test_data_point",
"tags": {},
"fields": {
"val": 15
},
"ts": 0
}
]
},
"props": null,
"tags": null,
"src": "-",
"ver": "1",
"uid": "080d0d3c-aacb-422b-aeda-a2210121456f"
}
proc_id - must be 1 unless you are using multiple Influx destinations, in that case, it must be a different number.
tags and fields will be converted to Influx tags and fields
There is also a fix for tibber adapter (not released) that publishes the current price from tibber every hour and additional improvement is in making that will publish all prices for the current day and the next day.
Thank you for this @alivinco , will look into this.
Do you have any estimate to share on the Tibber adapter going live? Sounds like it could be worth waiting for if its not too long in the future
Edit: I now saw in another thread that you no longer work for FH, so maybe we need someone else to chime in here
I will share my contribution to Tibber adapter with FH by end of the week and hopefully it won’t take that long for them to release it to public , right @espen ?
Once it’s there you can do something like this -
Any news on this new updated Tibber adapter @alivinco / @espen ?
Would love to build more advanced automations based on using averages of the prices for the whole day.
It’s ready and not only extracting a price for the current day but also for the next day. @espen can you help with publishing the new version of the tibber-app and ecollector?
In meantime, I can leave the links to the binaries here . @Gjaevert do you have a technical means of running a container or install on an external computer/rpi?
Ah, great news.
I have a Docker available on an external computer (Mac Mini), if that can be used to run this.
It took some time to “containerize” components and also do it in a way that it can be run on ARM and x86 based processors.
Dockerized versions of ecollector and tibber-ad are newer compared to what is available in FH Playgrounds, the new version supports price information (current and for next day) and other improvements.
Here is documentation of how to install and run ecollector , tibber-ad, and own influxdb instance on your own computer (outside of FH smarthub)
https://thingsplex.github.io/docs/thingsplex-system/docker.html
Also given that now all the data is collected in your own influxdb, you can connect Grafana directly to the DB
Hi @alivinco
I just got around to testing this.
I used the compose option from your example, but I have some struggles with connecting the different containers and need some input. (I get alot of MQTT connection failed)
Should the internal ecollector service be turned on again at any point, or should it be off as long as I rund these services in my external docker?
I ask because when I look to configure the Event Collector details after the new containers are live there is nothing here and I am unable to add anything.
For the MQTT details, as per your “Post-Installation steps”.
Is it correct that the MQTT broker host IP should be FuturhomeHubIP:1884
and the credentials can be of my choosing (which then subsequently need to be incluced in the compose file)?
I see that you have not defined any DB name or DB credentials in your Influx setup code.
Should I add that or is that unnecessary?
Sorry for all the questions, but I really want to try and get this going.
It looks like you’re doing everything correctly and the root cause might be this - “MQTT connection failed”. Did you put IP address+username+password of your smarthub into compose file? This of course assumes that you have enabled local API on smarthub and MQTT port is open.
Another question - what is the default network in your docker, is it bridge?
EDIT:
I made the mistake of totally overlooking the “Local API” setup in the app (I have never used MQTT before and are apparently a n00b).
But I enabled it now and it works!
All 3 containers are running and both Ecollector and Tibber have contact with the MQTT and I see them in the TP UI. Great success!
My logical next question now is, where can I see the prices/data published by Tibber.
(I would love to have them both in TP engine and in Influx DB)
So @alivinco, I may have come even one step further, but I still need some input if you can help.
Under “Adapters” in TP I now see additional fields for Tibber, outside main elec.
“price(sensor_price)” works ang gives me the current hours price in the UI here, in Message stream and I see the data populated in Influx+Grafana.
But the “price info service(price_info_elec)”, which I suspect should give me today and tomorrows hourly prices is not working the same way. I dont see any way to easily get that data. There is no button here to test and I cant find it as a service/thing to call in TPFlow.
Could I ask if you have any helpful info here on how to collect that price data?
Sure. You can either query the data but also price sensor report and full forecast report is generated once an hour automatically.
Here is the request :
topic : pt:j1/mt:cmd/rt:dev/rn:tibber/ad:1/sv:price_info_elec/ad:replace_with_your_tubbir_home_Id
{
"serv": "price_info_elec",
"type": "cmd.price_forecast.get_report",
"val_t": "string",
"val": "",
"props": {},
"tags": null,
"src": "-",
"ver": "1",
"uid": "c0409786-af24-496b-890a-f3bcba724180"
}
response :
{
"serv": "price_info_elec",
"type": "evt.price_forecast.report",
"val_t": "object",
"val": [
{
"level": "NORMAL",
"total": 1.8547,
"energy": 1.4758,
"tax": 0.3789,
"currency": "NOK",
"startsAt": "2022-01-11T00:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8079,
"energy": 1.4383,
"tax": 0.3696,
"currency": "NOK",
"startsAt": "2022-01-11T01:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7635,
"energy": 1.4028,
"tax": 0.3607,
"currency": "NOK",
"startsAt": "2022-01-11T02:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7605,
"energy": 1.4004,
"tax": 0.3601,
"currency": "NOK",
"startsAt": "2022-01-11T03:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7804,
"energy": 1.4163,
"tax": 0.3641,
"currency": "NOK",
"startsAt": "2022-01-11T04:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.8497,
"energy": 1.4718,
"tax": 0.3779,
"currency": "NOK",
"startsAt": "2022-01-11T05:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.8558,
"energy": 1.4766,
"tax": 0.3792,
"currency": "NOK",
"startsAt": "2022-01-11T06:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9145,
"energy": 1.5236,
"tax": 0.3909,
"currency": "NOK",
"startsAt": "2022-01-11T07:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.933,
"energy": 1.5384,
"tax": 0.3946,
"currency": "NOK",
"startsAt": "2022-01-11T08:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9302,
"energy": 1.5362,
"tax": 0.394,
"currency": "NOK",
"startsAt": "2022-01-11T09:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9294,
"energy": 1.5355,
"tax": 0.3939,
"currency": "NOK",
"startsAt": "2022-01-11T10:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9631,
"energy": 1.5625,
"tax": 0.4006,
"currency": "NOK",
"startsAt": "2022-01-11T11:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9331,
"energy": 1.5385,
"tax": 0.3946,
"currency": "NOK",
"startsAt": "2022-01-11T12:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9237,
"energy": 1.531,
"tax": 0.3927,
"currency": "NOK",
"startsAt": "2022-01-11T13:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9247,
"energy": 1.5318,
"tax": 0.3929,
"currency": "NOK",
"startsAt": "2022-01-11T14:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9355,
"energy": 1.5404,
"tax": 0.3951,
"currency": "NOK",
"startsAt": "2022-01-11T15:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9664,
"energy": 1.5651,
"tax": 0.4013,
"currency": "NOK",
"startsAt": "2022-01-11T16:00:00+01:00"
},
{
"level": "NORMAL",
"total": 2.1186,
"energy": 1.6869,
"tax": 0.4317,
"currency": "NOK",
"startsAt": "2022-01-11T17:00:00+01:00"
},
{
"level": "NORMAL",
"total": 2.0504,
"energy": 1.6323,
"tax": 0.4181,
"currency": "NOK",
"startsAt": "2022-01-11T18:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9285,
"energy": 1.5348,
"tax": 0.3937,
"currency": "NOK",
"startsAt": "2022-01-11T19:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9251,
"energy": 1.5321,
"tax": 0.393,
"currency": "NOK",
"startsAt": "2022-01-11T20:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.9314,
"energy": 1.5371,
"tax": 0.3943,
"currency": "NOK",
"startsAt": "2022-01-11T21:00:00+01:00"
},
{
"level": "NORMAL",
"total": 1.893,
"energy": 1.5064,
"tax": 0.3866,
"currency": "NOK",
"startsAt": "2022-01-11T22:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8279,
"energy": 1.4543,
"tax": 0.3736,
"currency": "NOK",
"startsAt": "2022-01-11T23:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8019,
"energy": 1.4335,
"tax": 0.3684,
"currency": "NOK",
"startsAt": "2022-01-12T00:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7711,
"energy": 1.4089,
"tax": 0.3622,
"currency": "NOK",
"startsAt": "2022-01-12T01:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7539,
"energy": 1.3951,
"tax": 0.3588,
"currency": "NOK",
"startsAt": "2022-01-12T02:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7508,
"energy": 1.3926,
"tax": 0.3582,
"currency": "NOK",
"startsAt": "2022-01-12T03:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7616,
"energy": 1.4013,
"tax": 0.3603,
"currency": "NOK",
"startsAt": "2022-01-12T04:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7825,
"energy": 1.418,
"tax": 0.3645,
"currency": "NOK",
"startsAt": "2022-01-12T05:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7829,
"energy": 1.4183,
"tax": 0.3646,
"currency": "NOK",
"startsAt": "2022-01-12T06:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8422,
"energy": 1.4657,
"tax": 0.3765,
"currency": "NOK",
"startsAt": "2022-01-12T07:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8725,
"energy": 1.49,
"tax": 0.3825,
"currency": "NOK",
"startsAt": "2022-01-12T08:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8356,
"energy": 1.4605,
"tax": 0.3751,
"currency": "NOK",
"startsAt": "2022-01-12T09:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.8053,
"energy": 1.4362,
"tax": 0.3691,
"currency": "NOK",
"startsAt": "2022-01-12T10:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7625,
"energy": 1.402,
"tax": 0.3605,
"currency": "NOK",
"startsAt": "2022-01-12T11:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7601,
"energy": 1.4001,
"tax": 0.36,
"currency": "NOK",
"startsAt": "2022-01-12T12:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7481,
"energy": 1.3905,
"tax": 0.3576,
"currency": "NOK",
"startsAt": "2022-01-12T13:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7269,
"energy": 1.3735,
"tax": 0.3534,
"currency": "NOK",
"startsAt": "2022-01-12T14:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.717,
"energy": 1.3656,
"tax": 0.3514,
"currency": "NOK",
"startsAt": "2022-01-12T15:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7181,
"energy": 1.3665,
"tax": 0.3516,
"currency": "NOK",
"startsAt": "2022-01-12T16:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7169,
"energy": 1.3655,
"tax": 0.3514,
"currency": "NOK",
"startsAt": "2022-01-12T17:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.7015,
"energy": 1.3532,
"tax": 0.3483,
"currency": "NOK",
"startsAt": "2022-01-12T18:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.6708,
"energy": 1.3286,
"tax": 0.3422,
"currency": "NOK",
"startsAt": "2022-01-12T19:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.6499,
"energy": 1.3119,
"tax": 0.338,
"currency": "NOK",
"startsAt": "2022-01-12T20:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.644,
"energy": 1.3072,
"tax": 0.3368,
"currency": "NOK",
"startsAt": "2022-01-12T21:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.624,
"energy": 1.2912,
"tax": 0.3328,
"currency": "NOK",
"startsAt": "2022-01-12T22:00:00+01:00"
},
{
"level": "CHEAP",
"total": 1.6078,
"energy": 1.2782,
"tax": 0.3296,
"currency": "NOK",
"startsAt": "2022-01-12T23:00:00+01:00"
}
],
"props": null,
"tags": null,
"src": "-",
"ver": "1",
"uid": "6987d9d7-a0e3-4e31-88dc-8f2e4bdb8e47",
"topic": "pt:j1/mt:evt/rt:dev/rn:tibber/ad:1/sv:price_info_elec/ad:dadc1266-82f8-4c01-8f7a-f5196fba6468"
}
Also, the information can be queried from collector , will share examples a bit later
Not sure if this solution has been presented before, but anyway I’ve been able to connect Grafana directly to the InfluxDB already running on the Futurehome hub (ecollector). So, no need for hosting or subscribing to separate InfluxDB service, and no need for MQTT. The Grafana setup can be found in Thingsplex>Analytics>Settings>Data collection settings>default>Configure, but I’ll repeat here for convenience:
For setting up the SQL queries once connected to the database, so far I’ve fetched data mainly from gen_raw (sensordata etc) and gen_default (on/off signals etc).
I’m hosting Grafana open-source via Container station (Docker) on QNAP NAS in my home but I guess if you’re still reading this you’re also able to open a port on your router and access it from outside if need be (or on a Windows computer
).
So far it appears to be running stable and not spending excessive resources querying Cube 1V1-EU.
I am running some docker containers on a rasperry pi and among these are NodeRed, influxDB and Grafana. Use NodeRed to get data from FH MQTT broker, do some processing and store the data I need in InfluxDB.
This setup has been running very stable for more than 6 months and I have buildt several Grafana dashboards to display and analyze data from HAN sensor, termostats, smart plugs and vater heater.