yes, in a package
That will work
The first one doesnât because the interior double quote isnât escaped
How is it supposed to be?
See the post I replied to. That code will work.
But it is not, Home-Assistant says âConfiguration Invalidâ
Because you still havenât used it. Your âproof of trying it postsâ show you using the previous one provided by Tom. His latest will work.
Edit: Iâm on mobile and having trouble quoting.
This from Tom
value_template: >
{{ value|replace('"','') }}
Sorry - I did not see the message of tom sorry. Thank you for help.
sorry - And thanks for the help.
So like this?
value_template: "{{ value|replace('\"','') }}"
I remember that single quotes are escaped with single quotes but double quotes use the backslash, yes?
Yeah. That should work.
\ will work for escaping any character typically. Admittedly, I donât have it memorized for jinja, but it should work similar to python.
You do realise ha has a glances integration, rendering all this unnecessary?
There is no everything - the operating time of the server, one example.
Yes I see that now. Maybe a feature request?
# curl http://localhost:61208/api/3/sensors/label/acpitz 1
{'acpitz 1': [{'critical': 105,
'key': 'label',
'label': 'acpitz 1',
'type': 'temperature_core',
'unit': 'C',
'value': 27,
'warning': 105}]}
my code:
- platform: rest
name: "Pi-4 Sensors"
resource: http://192.168.1.244:61208/api/3/sensors
value_template: "{{ value_json.unit }}"
unit_of_measurement: "C"
I do not think itâs true - so asking for help. Iâm not a programmer
That is not valid json. This is:
{"acpitz 1": [{"critical": 105,
"key": "label",
"label": "acpitz 1",
"type": "temperature_core",
"unit": "C",
"value": 27,
"warning": 105}]}
Did you copy it correctly?
https://glances.readthedocs.io/en/latest/api.html#get-sensors
I copied a ⌠Apparently I did not copy true.
When you open this http://192.168.1.244:61208/api/3/sensors
in a web browser what do you see?
pi@pihole-master:~ $ sensors
cpu_thermal-virtual-0
Adapter: Virtual device
temp1: +44.3°C