J'ai un script dzvent pour changer le nom d'un widget :
Code : Tout sélectionner
-- Icon changer
local ICON_RAIN = 116
local ICON_SUN = 117
return {
logging = {
level = domoticz.LOG_DEBUG, -- Select one of LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_FORCE to override system log level
},
on = {
devices = {404},
},
execute = function(dz, item)
local pluiej = dz.variables('Pluie-jour').value
print('start icon ' .. pluiej)
if item.level == 10 then
item.setIcon(ICON_RAIN)
item.rename('Aujourdhui - pluie : '..pluiej..'mm')
item.switchSelector(10).silent()
elseif item.level == 20 then
item.setIcon(ICON_SUN)
item.rename('Aujourdhui - soleil')
item.switchSelector(20).silent()
end
end
}Code : Tout sélectionner
2020-11-05 12:00:01.154 Status: dzVents: Info: Handling events for: "Aujourdhui - soleil", value: "Soleil"
2020-11-05 12:00:01.155 Status: dzVents: Info: ------ Start external script: icone-pluie-jour.lua: Device: "Aujourdhui - soleil (Virtualsensor)", Index: 404
2020-11-05 12:00:01.156 Status: dzVents: start icon 0.0
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: url = http://127.0.0.1:8080/json.htm?type=setused&used=true&name=Aujourdhui+-+soleil&description=&idx=404&switchtype=18&customimage=117
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: method = GET
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: post data = nil
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: headers = nil
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: callback = nil
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=renamedevice&idx=404&name=Aujourdhui+-+soleil
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: method = GET
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: post data = nil
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: headers = nil
2020-11-05 12:00:01.156 Status: dzVents: Debug: OpenURL: callback = nil
2020-11-05 12:00:01.156 Status: dzVents: Debug: Constructed timed-command: Set Level 20
2020-11-05 12:00:01.156 Status: dzVents: Debug: Constructed timed-command: Set Level 20 NOTRIGGER
2020-11-05 12:00:01.158 Status: dzVents: Info: ------ Finished icone-pluie-jour.luaParce ce que je veux mettre en place un second rasp qui aura le port 8181, donc je ne sais pas où modifier et quoi pour cet ip....
Merci.