Dear all..
Someone can explain what i can do with this scripts?
Is this perhaps a solution for my problem:
viewtopic.php?f=6&t=26209&e=1&view=unread#unread
Is it perhaps possible to push multiple dummy devices to Grafana...
I need some option to make in grafana my dummy switches visible.
Because domoticz is not pushmy dummy's into influxDB:
I found this in the wiki:
Code: Select all
Note to Virtual / Dummy sensors: If the HTTP link or MQTT is not sending any values to the database, check the update method of your virtual sensors in your scripts. If using the ['UpdateDevice'] method, you will directly write the value to the internal database without triggering an HTTPlink or MQTT update for this sensor. Better is to use the JSON API of Domoticz and update your virtual sensors this way.
https://www.domoticz.com/wiki/HttpLink
Only this part i do not understand...
I use this script, and i cannot get it into influxDB:
Code: Select all
local function DeviceUpdate(idx, value1)
local cmd = string.format("%d|0|%.2f", idx, value1)
--print(cmd)
table.insert (commandArray, { ['UpdateDevice'] = cmd } )
end
Debug = "Yes" -- Debugging aanzetten ("YES") of uitzetten ("NO")
commandArray = {}
local m = os.date('%M')
if (m % 4 == 0) then -- script loopt iedere 4 minuten
-- Variabelen instellen
local temperature_name = 'D.M.: Gemiddeld Buiten D'
local temperature_idx = otherdevices_idx[temperature_name]
local uitlees_name = 'Buiten: Terras'
local uitlees_idx = otherdevices_idx[uitlees_name]
--Temperaturen van afgelopen 24 uur opvragen
local sQuery = 'curl "http://192.168.5.70:8080/json.htm?type=graph&sensor=temp&idx='..tostring(uitlees_idx)..'&range=day"'
local handle=assert(io.popen(sQuery))
local raw = handle:read('*all')
handle:close()
--Ontvangen waarden verwerken
json = assert(loadfile '/home/pi/domoticz/scripts/lua/JSON.lua')()
local jsonData = json:decode(raw)
if Debug=='YES' then
print (jsonData.title)
print (jsonData.status)
print (jsonData.result[1].d)
print (jsonData.result[1].te)
end
--Gemiddelde temperatuur van afgelopen 24 uur bepalen
local sum = 0
local ave = 0
local elements = #jsonData.result
for i = 1, elements do
sum = sum + jsonData.result[i].te
end
ave = sum / elements
if Debug=='YES' then
print('Gemiddeld: '..tostring(ave))
end
--Gemiddelde temperatuur opslaan in virtuele temperatuur sensor
UpdateDevice --DeviceUpdate(temperature_idx,ave)
end
return commandArray
So i hope someone

Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups