Lua switch propriété
Publié : 04 janv. 2017, 08:52
Bonjour,
je me lance dans lua avec Domoticz, mais il me manque des infos, je vous explique j'ai un switch (une télécommande miantech) qui active mon alarme, elle fonctionne très bien, le soucis c'est quand je récupère son état il est indiqué "Open" alors que dans l'interface web j'ai la valeur Disarm, arm home ou arm away.
Mon switch (ma télécommande) a comme nom SetAlarme
J'ai récupéré l'état avec devicechanged['SetAlarme'] ou avec otherdevices['SetAlarme'] il me donne la valeur "Open".
Alors que si je fais une requête JSON on voit en rouge que je récupère bien disarm en status et data:
curl -s "http://192.168.x.xx/json.htm?type=devices&rid=6"
{
"ActTime" : 1483515980,
"ServerTime" : "2017-01-04 08:46:20",
"Sunrise" : "08:18",
"Sunset" : "17:02",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 100,
"CustomImage" : 0,
"Data" : "Disarm",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 4,
"HardwareName" : "RFXtrx433E",
"HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
"HardwareTypeVal" : 1,
"HaveDimmer" : false,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "7247E9",
"LastUpdate" : "2017-01-04 08:34:46",
"MaxDimLevel" : 0,
"Name" : "SetAlarme",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Disarm",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "Meiantech/Atlantic/Aidebao",
"SwitchType" : "Security",
"SwitchTypeVal" : 3,
"Timers" : "false",
"Type" : "Security",
"TypeImg" : "security",
"Unit" : 0,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "6"
}
],
"status" : "OK",
"title" : "Devices"
}
Est ce qu'il est possible sans intégrer JSON dans LUA de récupérer toutes ces valeurs(propriétés) ?
Merci de votre retour
je me lance dans lua avec Domoticz, mais il me manque des infos, je vous explique j'ai un switch (une télécommande miantech) qui active mon alarme, elle fonctionne très bien, le soucis c'est quand je récupère son état il est indiqué "Open" alors que dans l'interface web j'ai la valeur Disarm, arm home ou arm away.
Mon switch (ma télécommande) a comme nom SetAlarme
J'ai récupéré l'état avec devicechanged['SetAlarme'] ou avec otherdevices['SetAlarme'] il me donne la valeur "Open".
Alors que si je fais une requête JSON on voit en rouge que je récupère bien disarm en status et data:
curl -s "http://192.168.x.xx/json.htm?type=devices&rid=6"
{
"ActTime" : 1483515980,
"ServerTime" : "2017-01-04 08:46:20",
"Sunrise" : "08:18",
"Sunset" : "17:02",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 100,
"CustomImage" : 0,
"Data" : "Disarm",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 4,
"HardwareName" : "RFXtrx433E",
"HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
"HardwareTypeVal" : 1,
"HaveDimmer" : false,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "7247E9",
"LastUpdate" : "2017-01-04 08:34:46",
"MaxDimLevel" : 0,
"Name" : "SetAlarme",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Disarm",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "Meiantech/Atlantic/Aidebao",
"SwitchType" : "Security",
"SwitchTypeVal" : 3,
"Timers" : "false",
"Type" : "Security",
"TypeImg" : "security",
"Unit" : 0,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "6"
}
],
"status" : "OK",
"title" : "Devices"
}
Est ce qu'il est possible sans intégrer JSON dans LUA de récupérer toutes ces valeurs(propriétés) ?
Merci de votre retour