Soucis récupération JSON dans domoticz

Bonjour,

je récupère dans DomoticZ depuis longtemps une valeur de sonde de température via cette commande:

http://X.X.X.X:8080/json.htm?type=devices&rid=99

La requète me donne:

{
	"ActTime" : 1690181415,
	"AstrTwilightEnd" : "23:52",
	"AstrTwilightStart" : "03:21",
	"CivTwilightEnd" : "21:56",
	"CivTwilightStart" : "05:17",
	"DayLength" : "15:23",
	"NautTwilightEnd" : "22:46",
	"NautTwilightStart" : "04:27",
	"ServerTime" : "2023-07-24 08:50:15",
	"SunAtSouth" : "13:36",
	"Sunrise" : "05:55",
	"Sunset" : "21:18",
	"app_version" : "2023.1",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "20.6 C",
			"Description" : "",
			"Favorite" : 1,
			"HardwareDisabled" : false,
			"HardwareID" : 9,
			"HardwareName" : "Davis M\u00e9t\u00e9o",
			"HardwareType" : "Davis Vantage Weather Station USB",
			"HardwareTypeVal" : 10,
			"HaveTimeout" : false,
			"ID" : "000A",
			"LastUpdate" : "2023-07-24 08:50:00",
			"Name" : "Davis piscine",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "LaCrosse TX3",
			"Temp" : 20.600000000000001,
			"Timers" : "false",
			"Type" : "Temp",
			"TypeImg" : "temperature",
			"Unit" : 10,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "99",
			"trend" : 1
		}
	],
	"status" : "OK",
	"title" : "Devices"
}

Je souhaite récupérer la valeur Data. Pour cela j’utilise donc

result > 0 > Data

Ca fonctionnait depuis des lustres. Mais depuis qqs temps j’obtiens l’erreur 401 Json invalide ou non décodable.

Je comprends pas trop d’où vient le soucis…

Si qq a une idée…

Merci !!

Salut

Il faudrait utiliser la balise </> pour partager le json. On verrait ainsi mieux sa pagination.

Antoine

Oui, pardon, je ne suis pas trop au fait de ce genre de choses…

{
	"ActTime" : 1690179258,
	"AstrTwilightEnd" : "23:52",
	"AstrTwilightStart" : "03:21",
	"CivTwilightEnd" : "21:56",
	"CivTwilightStart" : "05:17",
	"DayLength" : "15:23",
	"NautTwilightEnd" : "22:46",
	"NautTwilightStart" : "04:27",
	"ServerTime" : "2023-07-24 08:14:18",
	"SunAtSouth" : "13:36",
	"Sunrise" : "05:55",
	"Sunset" : "21:18",
	"app_version" : "2023.1",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "20.6 C",
			"Description" : "",
			"Favorite" : 1,
			"HardwareDisabled" : false,
			"HardwareID" : 9,
			"HardwareName" : "Davis M\u00e9t\u00e9o",
			"HardwareType" : "Davis Vantage Weather Station USB",
			"HardwareTypeVal" : 10,
			"HaveTimeout" : false,
			"ID" : "000A",
			"LastUpdate" : "2023-07-24 08:13:54",
			"Name" : "Davis piscine",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "LaCrosse TX3",
			"Temp" : 20.600000000000001,
			"Timers" : "false",
			"Type" : "Temp",
			"TypeImg" : "temperature",
			"Unit" : 10,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "99",
			"trend" : 1
		}
	],
	"status" : "OK",
	"title" : "Devices"
}

La structure de json est la même qu’avant? Je ne me souvenais pas qu’il y avait une partie Array dans le json domoticz.

As-tu tester si tu avais accès à d’autres valeurs, avant la partie Array par exemple?

Antoine

Oula, je fais comment pour faire ca ? DSL je suis un peu largué…

Bonjour,

J’utilise la même méthode chez moi, ça fonctionne, moi je récupère le Temp

result>0>Temp