Could you give a short brief here about what you could do with Tibber and LM in combination? Did you get this working with Tibber API? Do you translate the hour prices to KNX GA?
Could you give a short brief here about what you could do with Tibber and LM in combination? Did you get this working with Tibber API? Do you translate the hour prices to KNX GA?
Hi.
Group addresses: Yes, I translate the Tibber values into Logic Machine Group Addresses. Per now over the bus-range of addresses, but I plan to change this to virtual addresses treduce the traffic load on the KNX bus. If you plan to show tibber values on a KNX visualization panel you might need to stay in the standard group addresses range.
Tibber integration: Per now I only use this for visualization purposes. Highlighting when prices are high or when consumption are high. Plus trending on prices and consumption.
So there is no magic going on with cutting power to items, lower heating, stop water heating etc according to prices. But it should be pretty straight forward. It would be pretty easy to make a for exmple a phillips HUE lamp to change color accodring to power prices or current power consumption if you wanted so.
For electrical vehicle and charging when it is cheap - i do believe that the TIbber / Eeesy charging solution is more streamlined and better (I do not have EV, so I have not tested this).
The Tibber integration has been working great for me - except one returning issue which is propably a programming error in one of my scripts (Scripts from this thread). It seems like the script either crashes or the Tibber API blocks the connection after some time. I don't know what is the problem, but I usually do the following:
- Deactivate / activate the Tibber script
- Restart the Logic Machine
- Manually change the group address value in Logic machine (example just put in a value "1" in consumption and price.
Could you give a short brief here about what you could do with Tibber and LM in combination? Did you get this working with Tibber API? Do you translate the hour prices to KNX GA?
Hi.
Group addresses: Yes, I translate the Tibber values into Logic Machine Group Addresses. Per now over the bus-range of addresses, but I plan to change this to virtual addresses treduce the traffic load on the KNX bus. If you plan to show tibber values on a KNX visualization panel you might need to stay in the standard group addresses range.
Tibber integration: Per now I only use this for visualization purposes. Highlighting when prices are high or when consumption are high. Plus trending on prices and consumption.
So there is no magic going on with cutting power to items, lower heating, stop water heating etc according to prices. But it should be pretty straight forward. It would be pretty easy to make a for exmple a phillips HUE lamp to change color accodring to power prices or current power consumption if you wanted so.
For electrical vehicle and charging when it is cheap - i do believe that the TIbber / Eeesy charging solution is more streamlined and better (I do not have EV, so I have not tested this).
The Tibber integration has been working great for me - except one returning issue which is propably a programming error in one of my scripts (Scripts from this thread). It seems like the script either crashes or the Tibber API blocks the connection after some time. I don't know what is the problem, but I usually do the following:
- Deactivate / activate the Tibber script
- Restart the Logic Machine
- Manually change the group address value in Logic machine (example just put in a value "1" in consumption and price.
One or all of these usually solves the problem.
Thank you for your report.
I got help from a colleague to make a script based on this thread and the only option I need now, is the price per hour. It's working now and it is pretty nice.
17.01.2021, 17:22 (This post was last modified: 17.01.2021, 17:27 by Jørn.)
(12.01.2021, 20:37)Rune Wrote:
(11.01.2021, 21:43)stemic01 Wrote:
(07.01.2021, 19:12)Rune Wrote: Jørn and stemic01:
Could you give a short brief here about what you could do with Tibber and LM in combination? Did you get this working with Tibber API? Do you translate the hour prices to KNX GA?
Hi.
Group addresses: Yes, I translate the Tibber values into Logic Machine Group Addresses. Per now over the bus-range of addresses, but I plan to change this to virtual addresses treduce the traffic load on the KNX bus. If you plan to show tibber values on a KNX visualization panel you might need to stay in the standard group addresses range.
Tibber integration: Per now I only use this for visualization purposes. Highlighting when prices are high or when consumption are high. Plus trending on prices and consumption.
So there is no magic going on with cutting power to items, lower heating, stop water heating etc according to prices. But it should be pretty straight forward. It would be pretty easy to make a for exmple a phillips HUE lamp to change color accodring to power prices or current power consumption if you wanted so.
For electrical vehicle and charging when it is cheap - i do believe that the TIbber / Eeesy charging solution is more streamlined and better (I do not have EV, so I have not tested this).
The Tibber integration has been working great for me - except one returning issue which is propably a programming error in one of my scripts (Scripts from this thread). It seems like the script either crashes or the Tibber API blocks the connection after some time. I don't know what is the problem, but I usually do the following:
- Deactivate / activate the Tibber script
- Restart the Logic Machine
- Manually change the group address value in Logic machine (example just put in a value "1" in consumption and price.
One or all of these usually solves the problem.
Thank you for your report.
I got help from a colleague to make a script based on this thread and the only option I need now, is the price per hour. It's working now and it is pretty nice.
I use this for price per hour, i use it as a scheduled script with 15 minute intervals. Insert token and replace "Strømpris denne time" with your group address or group name, 4 byte floating point datatype, output in "øre" ;o)
data = json.encode({
query = '{viewer {homes {currentSubscription {priceInfo {current {total}}}}}}' --kwh pris med avgifter
})
tbl = {}
res, code = https.request({
url = 'https://api.tibber.com/v1-beta/gql',
method = 'POST',
headers = {
['authorization'] = 'Bearer ' .. token,
['content-type'] = 'application/json',
['content-length'] = #data,
},
source = ltn12.source.string(data),
sink = ltn12.sink.table(tbl),
})
if res and code == 200 then
resp = table.concat(tbl)
resp = json.pdecode(resp)
homes = resp.data.viewer.homes
info = homes[ 1 ].currentSubscription.priceInfo.current
grp.write('Strømpris denne time', info.total*100)
else
log(res, code)
end
(11.01.2021, 21:43)stemic01 Wrote:
(07.01.2021, 19:12)Rune Wrote: Jørn and stemic01:
Could you give a short brief here about what you could do with Tibber and LM in combination? Did you get this working with Tibber API? Do you translate the hour prices to KNX GA?
Hi.
Group addresses: Yes, I translate the Tibber values into Logic Machine Group Addresses. Per now over the bus-range of addresses, but I plan to change this to virtual addresses treduce the traffic load on the KNX bus. If you plan to show tibber values on a KNX visualization panel you might need to stay in the standard group addresses range.
Tibber integration: Per now I only use this for visualization purposes. Highlighting when prices are high or when consumption are high. Plus trending on prices and consumption.
So there is no magic going on with cutting power to items, lower heating, stop water heating etc according to prices. But it should be pretty straight forward. It would be pretty easy to make a for exmple a phillips HUE lamp to change color accodring to power prices or current power consumption if you wanted so.
For electrical vehicle and charging when it is cheap - i do believe that the TIbber / Eeesy charging solution is more streamlined and better (I do not have EV, so I have not tested this).
The Tibber integration has been working great for me - except one returning issue which is propably a programming error in one of my scripts (Scripts from this thread). It seems like the script either crashes or the Tibber API blocks the connection after some time. I don't know what is the problem, but I usually do the following:
- Deactivate / activate the Tibber script
- Restart the Logic Machine
- Manually change the group address value in Logic machine (example just put in a value "1" in consumption and price.
One or all of these usually solves the problem.
I run in to this from time to time as well. I just created a script that checks if value has been updated recently and turns tibber script off and on. Have not had to do anything manual since. I run it as a scheduled script every 3 minutes.
Code:
obj = grp.find('Aktuelt forbruk watt') -- insert group address for consumption
delta = os.time() - obj.updatetime
if delta >= 10 then
script.disable('Tibber websocket') -- replace with the name of your tibber websocket script
os.sleep(1)
script.enable('Tibber websocket') -- replace with the name of your tibber websocket script
alert('Restartet Tibber script')
end
if res and code == 200 then
resp = table.concat(tbl)
resp = json.pdecode(resp)
log(resp.data.viewer.homes)
info = homes[1].currentSubscription.priceInfo.today[1].total
-- Value for hour 0-1
grp.write('33/0/0', info.total*100)
end
(09.08.2021, 23:01)Erwin van der Zwart Wrote: Try this:
Code:
value = resp.data.viewer.homes[1].currentSubscription.priceInfo.today[1].total
grp.write('33/0/0', tonumber(value) * 100)
That did work exactly like I wanted it to!
Tested with the first six values and they are just like in my Tibber App, just that API has one more decimal
30.01.2022, 10:07 (This post was last modified: 30.01.2022, 10:07 by victor.back.)
Hi.
I'm using this script and it works nice, now I want to present the next hour and second next hours price in my visualisation, and maybe my previous hours price.
I now get the price per hour in a scheduled script and grp.write this to a separate GAs, this script is running once a day. But just wanna show the next and second next hours next to the current price in visu.
Can I modify this script to always shoe the next hours price in the same GA? someone that have done the same solution?
(06.01.2023, 10:00)mjaanes Wrote: Tibber seem to have updated their API (see Tibber Developer).
Has anybody updated the LUA script to read consumption from HAN port via the Tibber API?
Use updated user.websocket library attached to this post.
Change token / homeId as needed. Add object updates at line 78. Use grp.checkupdate or grp.checkwrite so that LM is not overloaded with unnecessary duplicate values.
while true do
data, opcode, _, _, err = client:receive()
if data then
if opcode == ws.PING then
client:send(data, ws.PONG)
elseif opcode == ws.TEXT then
data = json.pdecode(data)
if type(data) == 'table' then
-- update objects here
end
end
else
log('receive failed: ' .. tostring(err))
break
end
end
else
log('connection failed: ' .. tostring(err))
end
18.01.2023, 19:28 (This post was last modified: 18.01.2023, 19:44 by eilert.)
(10.01.2023, 10:52)admin Wrote: Use updated user.websocket library attached to this post.
Change token / homeId as needed. Add object updates at line 78. Use grp.checkupdate or grp.checkwrite so that LM is not overloaded with unnecessary duplicate values.
while true do
data, opcode, _, _, err = client:receive()
if data then
if opcode == ws.PING then
client:send(data, ws.PONG)
elseif opcode == ws.TEXT then
data = json.pdecode(data)
if type(data) == 'table' then
-- update objects here
end
end
else
log('receive failed: ' .. tostring(err))
break
end
end
else
log('connection failed: ' .. tostring(err))
end
if client then
client:close()
client = nil
end
Hi, the new websocket.lua (or the new GraphQL transport protocol) seem to create a much more unstable connection than before. I get "Websocket receive failed: closed" 3-4 times per minute and I need to restart the resident script every 10 minute. Are the timeouts too short? Response code is 1006. I hope there will be a more stable approach to this
After updating the firmware on my LM4 to 20230607, I have got problems with my Tibber real-time subscription.
* string: connection failed: Websocket Handshake failed: Invalid Sec-Websocket-Accept (expected 1LdxwNzFf64n31QWSHxXqslHgAI= got nil)
Is the websocket file in post #35 also the right one for the LM4?