brinkgit
(Brinkgit)
January 22, 2023, 6:55pm
1
Hello,
i am struggling my way into HA.
Got a lot of things done, with help of some of you, but now I am stuck.
I do have some sensors defines in configuration.yaml with the same problem. As example:
- resource: http://10.0.0.3:8998/api/tags/process.json?presstrend
scan_interval: 600
sensor:
- name: weer_buiten_trend_luchtdruk
value_template: >-
{{ value_json.presstrend }}
That gives - at the moment - a state of “Rising slowly”
But when I do:
{{ is_state('sensor.weer_buiten_trend_luchtdruk' , 'Rising slowly') }}
The answer is ‘false’
And when I do:
{% set state = states('sensor.sensor.weer_buiten_trend_luchtdruk') %}
{{ state }}
The value of ‘state’ = unknown.
When I use the sensor in a template, you can see the state when entering the name. That has: ‘Rising slowly’
So the text is somewhere in the sensor, but cannot be used.
What do I do wrong?
Troon
(Troon)
January 22, 2023, 7:15pm
2
First one: maybe it has a space at the end? Try this to see if there’s a space hiding there:
{{ "x"~states("sensor.weer_buiten_trend_luchtdruk")~"x" }}
Second: you have an extra sensor.
in your template.
Tinkerer
(aka DubhAd on GitHub)
January 22, 2023, 7:16pm
3
You’ve got an extra sensor.
in there.
brinkgit
(Brinkgit)
January 22, 2023, 7:19pm
4
tried spaces: no result, still ‘unknown’
Double sensor is stupid from me, but it did not help.
brinkgit
(Brinkgit)
January 22, 2023, 7:20pm
6
getting rid of the second ‘sensor’ gives same result.
brinkgit
(Brinkgit)
January 22, 2023, 7:23pm
7
I also tried:
{{ is_state('sensor.weer_buiten_trend_luchtdruk' , '"Rising slowly"') }}
No result.
Still ‘unknown’.
Troon
(Troon)
January 22, 2023, 8:25pm
8
That was false
last time.
Please post the results from my template in post #2:
{{ "x"~states("sensor.weer_buiten_trend_luchtdruk")~"x" }}
brinkgit
(Brinkgit)
January 22, 2023, 8:37pm
9
See screenshot. Still ‘unknown’.
Troon
(Troon)
January 22, 2023, 8:43pm
10
OK: and what about the States screen filtered for luchtdruk
— like I’ve done here for octo
:
Then the history graph for the sensor? Anything in the logs?
123
(Taras)
January 22, 2023, 8:44pm
11
Go to Developer Tools > States, find sensor.weer_buiten_trend_luchtdruk
and see what is reported for its state
value.
If its state
value is shown as unknown
then that’s its actual value, not ‘Rising slowly’ as claimed by the popup message.
BTW, all of the tests you have already performed appear to confirm that the sensor’s state
value is unknown
so the UI’s popup is mistaken.
EDIT
Ninja’d by Troon
1 Like
123
(Taras)
January 22, 2023, 8:56pm
14
What’s the sensor’s value in the empty areas?
brinkgit
(Brinkgit)
January 22, 2023, 8:58pm
15
Data come from cumulus MX, what I started up today. Shut down, startup some times for testing purpose.
Shutdown = no data
brinkgit
(Brinkgit)
January 22, 2023, 9:08pm
16
A more complete screenshot:
Btw: restarted HA several times: also no difference.
123
(Taras)
January 22, 2023, 9:14pm
17
brinkgit:
Shutdown = no data
Would it be fair to say that the empty slots in the history chart represent when the sensor’s value was unknown
.
Currently, the sensor’s value in the history chart is Rising slowly
and that’s the same value displayed in Developer Tools > States. However you’re saying the following template, when tested in the Template Editor, reports unknown
instead of Rising slowly
?
{{ states.sensor.weer_buiten_trend_luchtdruk.state }}
brinkgit
(Brinkgit)
January 22, 2023, 9:18pm
18
Paste copy gives as result:
get rid of last ‘state’ at the end:
brinkgit
(Brinkgit)
January 22, 2023, 9:19pm
19
Exactly: that what I don’t understand…
brinkgit
(Brinkgit)
January 22, 2023, 9:19pm
20
Sorry, have to leave now, to morrow I’ll be back…