Hey!
i`m trying to extract a value from a nested json object. The config is via yaml file. The command topic is working. The state topic isn´t working (value of entity is always “unknown”)
here is the yaml config:
- unique_id: sw13
name: "Switch13"
state_topic: "tele/tasmota_XXXX/SENSOR"
command_topic: "cmnd/tasmota_XXXX/clientsend"
availability_topic: "tele/tasmota_XXXX/LWT"
payload_available: "Online"
payload_not_available: "Offline"
payload_on: "S 13=1"
payload_off: "S 13=0"
value_template: "{{ value_json.TasmotaClient.13 }}"
state_on: 1
state_off: 0
optimistic: false
qos: 0
retain: false
The json response is the following:
{
"Time": "2024-06-24T21:46:27",
"TasmotaClient": {
"0": 0,
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"6": 0,
"7": 0,
"8": 0,
"9": 0,
"10": 0,
"11": 0,
"12": 0,
"13": 0,
"14": 0,
"15": 0,
"16": 0,
"17": 0,
"18": 0,
"19": 0
}
}