Sprit json value in value_template

Hi All,

I have this sensor config:

---
platform: rest
resource: http://WWW LINK/ssh.json
method: GET
name: "MVPS SSH Login Client IP"
value_template: "{{ value_json['ssh']['ip'] }}"

output:
1.2.3.4 63923 1001

how can I split this up so I only get the β€˜1.2.3.4’ as value?

value_template: "{{ value_json['ssh']['ip'].split(' ')[0] }}"

Thanks !!! don’t know how it work but it work :slight_smile: split makes array?
[0] 1.2.3.4
[1] 63923
[2] 1001

and [0] means show only this one?

You got it

:smiley: im graduated now haha

1 Like