Page 1 of 1
Youless meter with LAN interface
Posted: Sunday 20 May 2018 13:24
by Knibor
Hello, I have some questions about Domoticz with the Youless LAN Interface that I use.
In the the "Tab" Utility I can see the power measurement from the "Youless" .
The PV delivers back to the grid, and the power shows negative numbers. This is correct.
I want to switch on a heat pump when I deliver back more than 1500Watt (reading Domoticz/Utility/Youless power -1500Watt).
I used "blockly" to switch on the heat pump when I deliver more than -1500 Watt, but this is not working when I use "user variables" with a negative
number. When I set "user variabele" with a positive number, it works perfect.
Can someone help me how to solve this problem! (is this possible with "blockly" ?)
Re: Youless meter with LAN interface
Posted: Sunday 20 May 2018 20:27
by waaren
Knibor wrote: Sunday 20 May 2018 13:24
I want to switch on a heat pump when I deliver back more than 1500Watt (reading Domoticz/Utility/Youless power -1500Watt).
Can someone help me how to solve this problem! (is this possible with "blockly" ?)
I do not use blockly very often so I am not sure that it cannot be done but I would not know how to do this in blockly.
In dzVents I would use something like
Code: Select all
--[[ P1_delivery.lua
]]--
return {
on = { devices = { "Power" } } ,
logging = { level = domoticz.LOG_INFO,
marker = "P1_Delivery" },
execute = function(dz,trigger)
local usage = trigger.usage
local usageDelivered = trigger.usageDelivered
if usageDelivered > 0 then
dz.log("Return to the grid: ".. usage .. " Watt",dz.LOG_INFO )
elseif usage > 0 then
dz.log("Use from the grid: ".. usage .. " Watt",dz.LOG_INFO )
else
dz.log("Perfect in balance with the grid: " .. usage .. " Watt",dz.LOG_INFO )
end
end
}
Re: Youless meter with LAN interface
Posted: Monday 21 May 2018 10:17
by Knibor
Hello, thanks for the example.
I tried this "dzVents" code ,I only changed "dz.log("Return to the grid: ".. usage .. " Watt",dz.LOG_INFO )" to
dz.log("Return to the grid: ".. usageDelivered .. " Watt",dz.LOG_INFO ). Now I can read in the log " dzVents: Info: P1_Delivery: Return to the grid: 2183 Watt"
Now I want to see the "Return to the grid value "Watt" in a virtual device.
I create a virtual device "usageDelivered" and in devices he shows me Idx 50
I take some time to read in the Domoticz manual, but don't find the way to do it.
How can I connect this "Return to the grid value "Watt" to an virtual device with Idx 50?
Re: Youless meter with LAN interface
Posted: Monday 21 May 2018 10:45
by waaren
Knibor wrote: Monday 21 May 2018 10:17
..
Now I want to see the "Return to the grid value "Watt" in a virtual device.
I create a virtual device "usageDelivered" and in devices he shows me Idx 50
How can I connect this "Return to the grid value "Watt" to an virtual device with Idx 50?
As always

the answer is.. it depends.
Will be something like dz.devices("usageDelivered").update.... (usageDelivered) or dz.devices("usageDelivered").update.... (tostring(usageDelivered))
The method to update the virtual device depends on with what type / subtype you defined the virtual device. For a textdevice the updatemethod is different then for a P1 or counter type. Find all available methods
here
Re: Youless meter with LAN interface
Posted: Monday 21 May 2018 23:12
by Knibor
Hello, i made an virtual device
62 usageDelivered 00082062 1 Grid General kWh 0 kWh - - Set UnusedRename Device Log 2018-05-21 22:50:00
And ad this line "devices(Grid).updateGrid(Grid)"
See the script :
--[[ P1_delivery.lua
]]--
return {
on = { devices = { "Power" } } ,
logging = { level = domoticz.LOG_INFO,
marker = "P1_Delivery" },
execute = function(dz,trigger)
local usage = trigger.usage
local usageDelivered = trigger.usageDelivered
if usageDelivered > 0 then
dz.log("Return to the grid: ".. usageDelivered .. " Watt",dz.LOG_INFO )
elseif usage > 0 then
dz.log("Use from the grid: ".. usage .. " Watt",dz.LOG_INFO )
devices(Grid).updateGrid(Grid)
end
end
}
But I don't see that the the device "Grid"is updated, can you help me with this.
Re: Youless meter with LAN interface
Posted: Tuesday 22 May 2018 0:27
by waaren
Knibor wrote: Monday 21 May 2018 23:12
62 usageDelivered 00082062 1 Grid General kWh 0 kWh - - Set UnusedRename Device Log 2018-05-21 22:50:00
And ad this line "devices(Grid).updateGrid(Grid)"
But I don't see that the the device "Grid"is updated, can you help me with this.
@Knibor, sure. Something like this should do it
Code: Select all
--[[ P1_delivery.lua
]]--
return {
on = { devices = { "Power" } } ,
logging = { level = domoticz.LOG_INFO,
marker = "P1_Delivery" },
execute = function(dz,trigger)
local usage = trigger.usage
local usageDelivered = trigger.usageDelivered
local gridDevice = dz.devices(62)
local gridValue = 0
if usageDelivered > 0 then
dz.log("Return to the grid: ".. usageDelivered .. " Watt",dz.LOG_INFO )
gridValue = usageDelivered
elseif usage > 0 then
dz.log("Use from the grid: ".. usage .. " Watt",dz.LOG_INFO )
gridValue = -usage
else
dz.log("Perfect in balance with the grid: " .. usage .. " Watt",dz.LOG_INFO )
end
gridDevice.updateElectricity(gridValue) -- Assuming your device is defined as elektric (instant + counter)
end
}
Re: Youless meter with LAN interface
Posted: Wednesday 23 May 2018 7:32
by Knibor
Hello, thanks a lot for the script.
I see now a little light on the horizon.
Everything works fine now.
Re: Youless meter with LAN interface
Posted: Thursday 21 June 2018 22:48
by Knibor
Hi, after a while using this script, I can see the actual power in "Watts" but the "KWH counter" doesn't work.
Wat isn't correct in the script?
Can you help me with this!