Many thanks @waaren for your answer.
1) I have to mention, that I read the "Get started" and followed the instructions. So the tipps for starting dzVents I have done

. Thats what I meant in my first post with "II followed the wiki tutorial..." sorry for unclear statement.
Also I thought, that my last two sentences will explain, that the dzVents basically work. Or isn't it a hint for working?
2) My issues are two things:
- My adopted devices are not visible for programming tasks
- My workaround with a variable didn't work with dzVents
3) The screenshots to devices

- utils.png (95.08 KiB) Viewed 453 times
This are my devices I added to domoticz with the commands, I wrote in my first post.
I wrote a lua script to get the values from the device and than update domoticz with this commands:
Code: Select all
commandArray[1] = {['UpdateDevice'] = idx_PV .. '|0|' .. PAC .. ';' .. DAY_ENERGY} -- PV-Leistung
commandArray[2] = {['UpdateDevice'] = idx_VERBRAUCH .. '|0|' .. EVUNetz } -- Einspeisung/Bezug
commandArray[3] = {['UpdateDevice'] = idx_EIGENVERBRAUCH .. '|0|' .. VERBRAUCH } -- Akt. Verbrauch
commandArray['Variable:nGrid'] = tostring(EVUNetz); -- for workaround
It's triggered with "Device". But I also tried triggered "All". That is not the problem. In my log I get:
Code: Select all
2020-04-02 10:12:30.597 Status: EventSystem: Script event triggered: FroniusAdapter
FroniusAdapter is the name of the Script. I think this is the hint, that the script was done sucessfull
The values in the device tab are updated in a correct manner
What not work is the dcVent - script:
Code: Select all
return {
on = {
devices = {
'Smartmeter','FroniusAdapter','POW_01'
}
},
execute = function(domoticz, device)
domoticz.log('>>>>> Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
end
}
The value I want to trigger is 'Smartmeter'. It's listed in the list of devices at the domoticz programming site:

- dv.png (45.13 KiB) Viewed 453 times
but the scrip will
not be triggered. Also it is
not usable in a normal lua script with:
Code: Select all
local meter = otherdevices['Smartmeter']
To test the basic working of the dcVent script I added a Sonoff basic switch called POW_01. If I switch it on/off in the switches Tab I get the protocol output:
Code: Select all
2020-04-02 10:40:49.295 Status: User: Admin initiated a switch command (3/POW_01/Off)
2020-04-02 10:40:49.437 Status: dzVents: Info: Handling events for: "POW_01", value: "Off"
2020-04-02 10:40:49.437 Status: dzVents: Info: ------ Start internal script: evTestDevice: Device: "POW_01 (Dummy devices)", Index: 3
2020-04-02 10:40:49.437 Status: dzVents: Info: >>>>> Device POW_01 was changed
2020-04-02 10:40:49.437 Status: dzVents: Info: ------ Finished evTestDevice
2020-04-02 10:40:49.611 Status: EventSystem: Script event triggered: FroniusAdapter
So that works fine! (The counters - of course I cannot trigger manually from the visual view, but they will be triggerd by a change of the value in my lua script.)
4) So I did the workaround with a user variable:
In the source code where I get the values from the device and write them to the commandArray (see above) I add the following line:
Code: Select all
commandArray['Variable:nGrid'] = tostring(EVUNetz);
In my lua script I can than use it with:
but
not in dzVent:
Code: Select all
return {
on = {
variables = {
'Grid','nGrid','sGrid'
}
},
execute = function(domoticz, variable)
domoticz.log('>>>>>>>>>> Variable ' .. variable.name .. ' was changed'..'to: '..variable, domoticz.LOG_INFO)
-- code
end
}
(I tried several ways of triggering, so there are additional variables sGrid and Grid as normal global variables which I set in the lua script.)
the userVariable is set in Settings-Option-User variable:

- var.png (36.29 KiB) Viewed 453 times
So I hope you now have enougth information to help me. If not, as a different way, we can make a direct connection (mail,whatsapp, teamviewer,..), if you want. And than post the result here for others.
Many thanks in foreward