failing to see the correct structure, please help me out here:
sensor:
- platform: rest
name: Iungo firmware
resource: !secret iungo_url
method: POST
payload: '{"seq":1, "method":"fw_get_remote_info"}'
value_template: >
{{value_json.rv.fw.version}}
json_attributes_path: > #also tried {{value_json.rv.fw}}
$.[3].fw
json_attributes:
- date
- status
- build
- version
scan_interval: 86400
- platform: command_line
name: Iungo firmware cmd
command: >
curl -X POST -d '{"seq":1,"method":"fw_get_remote_info"}' http://192.168.1.27/iungo/api_request
value_template: >
{{value_json.rv.fw.version}}
json_attributes:
- date
- status
- build
- version
scan_interval: 86400
both result in the correct value_template, but both fail to set the attributes.
this is the output of the curl command:
curl -X POST -d '{"seq":1,"method":"fw_get_remote_info"}' http://192.168.1.27/iungo/api_request
{"ok":true,
"type":"response",
"time":0.61230495500058,
"rv":{"fw":{"date":"Fri Aug 21 16:01:24 CEST 2020","status":"","version":"1.5","build":"3638"}},
"systime":1605363708,
"seq":1,
"error":false}
thanks for having a look!
using $.rv.fw
is supposed to bring me to the correct path,
but doesnt work either, it simply doesnt return any attribute