IDX of the water main meter: 871
IDX of garden water meter: 1146
IDX of water meter to be calculated: 1164
According to the IDX the script has to calculate: 871 - 1146 = 1164
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamcommandArray = {}
-- loop through all the changed devices
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName=='L123FW') then
commandArray['OpenURL']='http://192.168.0.113/control?cmd=LCD,1,1,'..tostring(deviceValue)..'_W'
end
if (deviceName=='L123FkWh') then
commandArray['OpenURL']='http://192.168.0.113/control?cmd=LCD,2,1,'..tostring(deviceValue)..'_kWh'
end
end
return commandArraycommandArray = {}
print ("All based event fired");
-- loop through all the devices
for deviceName,deviceValue in pairs(otherdevices) do
-- if (deviceName=='myDevice') then
-- if deviceValue == "On" then
-- print("Device is On")
-- elseif deviceValue == "Off" then
-- commandArray['a device name'] = "On"
-- commandArray['Scene:MyScene'] = "Off"
-- end
-- end
end
-- loop through all the variables
for variableName,variableValue in pairs(uservariables) do
-- if (variableName=='myVariable') then
-- if variableValue == 1 then
-- commandArray['a device name'] = "On"
-- commandArray['Group:My Group'] = "Off AFTER 30"
-- end
-- end
endTL;DR: Domoticz writes new sensor values to its internal SQLite database every 5 minutes [Elektroda, xury, post #21444762] “Writing faster than 5 minutes needs source recompilation” [Elektroda, xury, post #21444762]
Why it matters: knowing native limits avoids unnecessary SD-card wear and lost datapoints.
• Default Domoticz database commit interval: 300 s (fixed) [Elektroda, xury, post #21444762] • dzVents ‘every minute’ timer fires 1 440 times per day [dzVents Wiki] • PZEM-004T measures 0–20 A RMS, ±1% typical accuracy (PZEM-004T v3 datasheet) • Sonoff Basic relay handles 10 A/2.2 kW, price ≈ US $6 [ITEAD, 2024] • Telegram Bot API needs Chat ID + Token; no RPi app required [Elektroda, xury, post #17946092]
main/Domoticz.cpp and re-compile, or bypass Domoticz by pushing values directly to InfluxDB or MQTT [Elektroda, xury, post #21444762]devicechanged or uservariables table is nil in All-Events context. Wrap the loop in if devicechanged then … end, or switch the script type to ‘Device’ so the engine populates those tables [Elektroda, sznickers, post #21447539]
return {
on = { timer = { 'every minute' } },
execute = function(dz)
local main = dz.devices(871).counter
local lawn = dz.devices(1146).counter
dz.devices(1164).updateCounter(main - lawn)
end
}
Replace the IDX numbers if they differ [Elektroda, Maciek1008, post #20804762]device.updateCurrent(L1,L2,L3) in dzVents. Example shown by xury consolidates IDX 5-7 into IDX 16 and updates every new value [Elektroda, xury, post #17750955]PUT with XML payload to /ISAPI/System/Video/inputs/channels/1/overlays using digest auth. Node-RED flow in the thread updates two temperature strings every minute [Elektroda, xury, post #19193707]ffmpeg on the RPi. 2. Save the provided doorbell.sh script with execution rights. 3. Add the dzVents script that runs os.execute('/home/pi/domoticz/scripts/doorbell.sh') when device ‘Dzwonek’ turns ON. The script records 5 s RTSP clip and posts it via Telegram Bot API [Elektroda, xury, post #17941615]adb on the server, then use an Exec node: etherwake -i <iface> <MAC> && adb connect <IP>:5555 && adb shell input keyevent KEYCODE_POWER. Flow by xury also maps D-Pad and volume keys to Nora scenes for voice control [Elektroda, xury, post #18620730]ESS_OVERRIDE=1 and STATE=2 via MQTT to Victron’s Venus OS. The shared Node-RED flow blocks export and resumes when prices normalize [Elektroda, xury, post #21467173]