This need openWb
Per MQTT zu schreiben:
openWB/set/pv/1/W PV-Leistung in Watt, int, negativ
openWB/set/pv/1/WhCounter Erzeugte Energie in Wh, float, nur positiv
Output Omnik/PVoutput
- Spoiler: show
Moderator: leecollings
Could look like below
Code: Select all
local scriptVar = 'solar2omnik'
return
{
on =
{
devices =
{
'Zonne Panelen',
},
shellCommandResponses =
{
scriptVar,
}
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = scriptVar,
},
execute = function(dz, item)
if item.isDevice then
local MQTTBase = "mosquitto_pub " -- or full qualified program name
local omnikLeistung = MQTTBase ..' -m ' .. (item.actualWatt * -1) .. ' -t openWB/set/pv/1/W '
local omnikErzeugt = MQTTBase .. ' -m '.. item.WhTotal .. ' -t openWB/set/pv/1/WhCounter '
dz.executeShellCommand(
{
command = omnikLeistung .. '; ' .. omnikErzeugt,
callback = scriptVar,
timeout = 10,
})
elseif item.isShellCommandResponse then
if item.statusCode == 0 then
dz.log('commands processed OK',dz.LOG_DEBUG)
else
dz.log('commands processed NOK',dz.LOG_ERROR)
dz.log(item,dz.LOG_DEBUG)
end
end
end
}
So I guess changing line 28 from
Code: Select all
local omnikErzeugt = MQTTBase .. ' -m '.. item.WhTotal .. ' -t openWB/set/pv/1/WhCounter '
Code: Select all
local omnikErzeugt = MQTTBase .. ' -m '.. item.counterToday .. ' -t openWB/set/pv/1/WhCounter '
Users browsing this forum: No registered users and 1 guest