Value out of platfrom "rest" smaler the 10 are not shown

Hello,
i grap the temperaturevalues and illuminanace from my Mobotix M16B via plattform rest, but in the values smaller then 10°C are not shown in the graph.
have someone an idea?

grafik

code:

update,here are the correct values shown, but not in the graph::
grafik

Does the response from the REST resource include the “+” for temperatures below 10°C but not above?

Perhaps try including this in the sensor definition:

value_template: "{{ value|float }}"

If that doesn’t work, please paste the response you’re getting from your resource. When pasting code (like your sensor definition above), please use the </> button to format it correctly.

Hi,
thank you, i have add this line, i have to wait until the temperature outdoor is below +10°C to see if its works or not

Hello,
now the value < +10 = 0
grafik

Code:
  - platform: rest
    resource: http://yyyyyyyyy/control/rcontrol?action=gettext&message=$(SEN.TOU.CELSIUS)
    method: GET
    username:yyyyyyy
    password: yyyyyyyy
    scan_interval: 60
    authentication: basic
    name: MX16 T_aussentemperatur
    unit_of_measurement: "°C"
    value_template: "{{ value|float }}"
    device_class: temperature
  - platform: rest
    resource: http://yyyyyyyy/control/rcontrol?action=gettext&message=$(SEN.TIN.CELSIUS)
    method: GET
    username:yyyyyyyy
    password: yyyyyyyyyy
    scan_interval: 60
    authentication: basic
    name: MX16 T_innentemperatur
    unit_of_measurement: "°C"
    value_template: "{{ value|float }}"
    device_class: temperature

OK, I think I’ve got it. You didn’t post the response like I asked, but looking closely at your 4.2°C example above, it looks like “+ 4.2” with a space. Putting that through float gives 0, whereas “+4.2” gives 4.2.

So, try this:

value_template: "{{ value.replace(' ', '')|float }}"

Hello Troon,
thank you now it works… the + symbol is not shown any more. What happened when we get negative temperatures outside?
Hier the output from the CAM direct:

the cam send the + or - symbol +5.7 or -5.7

Moritz

I try it, i have manipulate the values from the cam… to -11°C:
grafik

→ it works!!!

grafik

My template removes the space that is there when the temperature is below 10 — the space was breaking the conversion from a string to a number.

Glad it works for you :slightly_smiling_face:.

Hi Troon,

for me it is perfect… after a litte adjustment the values are correct, also with Grafna and Influx the curves are correct!!!

grafik

1 Like