Hi i m’ in trouble using domotz api and rest , if some one could help me it was welcome !
api extract a json like this :
`[
{
“id”: 3154932,
“display_name”: “Nvidia Shield”,
“protocol”: “IP”,
“snmp_status”: “NOT_FOUND”,
“user_data”: {
“name”: “Nvidia Shield”
},
“first_seen_on”: “2019-02-06T21:49:06+00:00”,
“importance”: “FLOATING”,
“type”: {
“detected_id”: 114,
“id”: 29,
“label”: “Media Player”
},
“details”: {
“zone”: “RDC”,
“room”: “Salon”,
“firmware_version”: null,
“serial”: null,
“notes”: null,
“snmp_read_community”: “public”,
“snmp_write_community”: “private”
},
“os”: {
“name”: “android”,
“version”: null,
“build”: null
},
“ip_addresses”: [
“192.168.x.xxx”
],
“last_status_change”: “2025-01-08T21:03:55+00:00”,
“status”: “DOWN”,
“vendor”: “NVIDIA”,
“grace_period”: 120,
“model”: “SHIELD TV Pro”,
“agent_reachable”: true,
“open_ports”: {
“tcp”: [
],
"udp": [
]
},
"hw_address": "00:04:4B:86:E4:F4",
"names": {
"host": "NvidiaShield.lan",
"bonjour": "SHIELD-Android-TV-xxx",
"upnp": "SHIELD",
"netbios": "SHIELD",
"zeroconf": "Android"
},
"is_jammed": false
},`
i have a rest config in my configuration file with working count of ONLINE and inventory device :
`rest:
-
resource: https://api-eu-west-1-cell-1.domotz.com/public-api/v1/agent/xxxxxx/device
method: GET
headers:
Accept: application/json
X-Api-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scan_interval: 300 # Intervalle de mise à jour en secondes
sensor:Sensor Ok
- name: Domotz Devices Inventory
value_template: ‘{{ value_json | length }}’
json_attributes:- devices
Sensor Ok
- name: Domotz Devices Online
value_template: >
{{ value_json | selectattr(‘status’, ‘equalto’, ‘ONLINE’) | list | length }}
json_attributes_path: “$.”
json_attributes:- devices`
- name: Domotz Devices Inventory
My problems is when i want to create a card to list ONline devices , i can’t found how to do