Youless meter with LAN interface

Post Reply
Knibor
Posts: 46
Joined: Sunday 20 May 2018 12:56
Target OS: OS X
Domoticz version: Beta
Contact:

Youless meter with LAN interface

Post by Knibor » Sunday 20 May 2018 13:24

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" ?)

User avatar
waaren
Posts: 1238
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Youless meter with LAN interface

Post by waaren » Sunday 20 May 2018 20:27

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
}
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Knibor
Posts: 46
Joined: Sunday 20 May 2018 12:56
Target OS: OS X
Domoticz version: Beta
Contact:

Re: Youless meter with LAN interface

Post by Knibor » Monday 21 May 2018 10:17

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?

User avatar
waaren
Posts: 1238
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Youless meter with LAN interface

Post by waaren » Monday 21 May 2018 10:45

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 :D 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
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Knibor
Posts: 46
Joined: Sunday 20 May 2018 12:56
Target OS: OS X
Domoticz version: Beta
Contact:

Re: Youless meter with LAN interface

Post by Knibor » Monday 21 May 2018 23:12

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.

User avatar
waaren
Posts: 1238
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Youless meter with LAN interface

Post by waaren » Tuesday 22 May 2018 0:27

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
}
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Knibor
Posts: 46
Joined: Sunday 20 May 2018 12:56
Target OS: OS X
Domoticz version: Beta
Contact:

Re: Youless meter with LAN interface

Post by Knibor » Wednesday 23 May 2018 7:32

Hello, thanks a lot for the script.

I see now a little light on the horizon.

Everything works fine now.

Knibor
Posts: 46
Joined: Sunday 20 May 2018 12:56
Target OS: OS X
Domoticz version: Beta
Contact:

Re: Youless meter with LAN interface

Post by Knibor » Thursday 21 June 2018 22:48

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!
Attachments
Schermafbeelding 2018-06-21 om 22.43.59.png
Schermafbeelding 2018-06-21 om 22.43.59.png (171.54 KiB) Viewed 701 times

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests