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" ?)
Youless meter with LAN interface
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Youless meter with LAN interface
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.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" ?)
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
}Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Knibor
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Youless meter with LAN interface
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?
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?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Youless meter with LAN interface
As alwaysKnibor 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?
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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Knibor
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Youless meter with LAN interface
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.
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.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Youless meter with LAN interface
@Knibor, sure. Something like this should do itKnibor 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.
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
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Knibor
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Youless meter with LAN interface
Hello, thanks a lot for the script.
I see now a little light on the horizon.
Everything works fine now.
I see now a little light on the horizon.
Everything works fine now.
-
Knibor
- Posts: 112
- Joined: Sunday 20 May 2018 12:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Youless meter with LAN interface
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!
Wat isn't correct in the script?
Can you help me with this!
- Attachments
-
- Schermafbeelding 2018-06-21 om 22.43.59.png (171.54 KiB) Viewed 1598 times
Who is online
Users browsing this forum: No registered users and 1 guest