Hello, I can get one attribute of a sensor but not more. It should be possible. I would like to get two attributes that have different path, but this configuration is not working.
If I create separate sensors with just one attribute as specified in REST documentation, it works. What is wrong please?
sensor 51:
- platform: rest
resource: https://chain.api.btc.com/v3/block/latest
method: GET
json_attributes:
- height:
value_template: "{{ value_json.height }}"
json_attributes_path: data
- pool_name:
value_template: "{{ value_json.pool_name }}"
json_attributes_path: data.extras
name: btc-blocks
the orginal response is here:
{“data”:{“height”:709812,“version”:536870916,“mrkl_root”:“f27a6c6dde6ee9661621d6fff092f589dd9328e838b828bf783c9b6fa3bf94bb”,“timestamp”:1636970203,“bits”:386689514,“nonce”:3355786303,“hash”:“00000000000000000002ade8c0f4d69fec9a9215740f4987f193a8acc92c049f”,“prev_block_hash”:“0000000000000000000604bb97e582a1ec9d078a252cace86fe14e734a8c53a3”,“next_block_hash”:“0000000000000000000000000000000000000000000000000000000000000000”,“size”:1702679,“pool_difficulty”:105052978488386,“difficulty”:22674148233453,“difficulty_double”:22674148233453.105,“tx_count”:1469,“reward_block”:625000000,“reward_fees”:6224133,“confirmations”:1,“is_orphan”:false,“curr_max_timestamp”:1636970203,“is_sw_block”:true,“stripped_size”:763597,“sigops”:13047,“weight”:3993470,“extras”:{“pool_name”:“AntPool”,“pool_link”:“https://www.antpool.com/"}},“err_code”:0,“err_no”:0,“message”:“success”,“status”:"success”}