#Message malformed: expected float for dictionary value @ data['value']

40 messages Β· Page 1 of 1 (latest)

grim zodiac
#

Hello everyone, having a bit of a problem with sending a float to a device. What I have now is a script triggered every 10 minutes by an automation:

alias: TempToiletUpdateInputNumber
sequence:

  • action: input_number.set_value
    metadata: {}
    data:
    value: "{{ states('sensor.sensortvoctoiletstue_temperature') |float(8)*100 }}"
    target:
    entity_id: input_number.temp_toilet_stue
  • device_id: f6382c4875c06eadc67e40152187efa7
    domain: number
    entity_id: ea4ba049fbb95513a6fcae3021ba7947
    type: set_value
    value: "{{ states('sensor.sensortvoctoiletstue_temperature') |float(8)*100 }}"
    description: ""
    icon: mdi:temperature-celsius

It's the last value that's the problem. I tried without the "", same error message. I tried with input_number.temp_toilet_stue. And other things. Keep getting the error message "Message malformed: expected float for dictionary value @ data['value']" . When reading the content of input_number.temp_toilet_stue it >looks< like a float, but might be a string... Help please? πŸ™‚

languid smelt
#

you cannot use templates in a device action

#

also:

unique solarBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

grim zodiac
#

Knew I formatted it incorrectly πŸ™‚ sorry

languid smelt
#

why are you doing the same thing twice in different ways?

grim zodiac
#

ehm, I guess I don't know how to convert the content of say input_number.temp_toilet_stue to a non-template

#

yes, it is to test it

languid smelt
#

you already know - you did it in the first one

#

I don't see what the point of the second call is

grim zodiac
#

no, I did not send it to the device

#

to send it to my device

languid smelt
#

neither is sending anything to a device

grim zodiac
#

Should it not set the value for that device?

languid smelt
#

My point is that you have two actions in your example. The first uses a service call and supports a template. The second does not

grim zodiac
#

I deleted the first

languid smelt
#

don't use a device at all. use the entity and follow the first action you already have

#
action: input_number.set_value
  metadata: {}
  data:
    value: "{{ states('sensor.sensortvoctoiletstue_temperature') |float(8)/100 }}"
  target:
    entity_id: input_number.temp_toilet_stue
#

you already posted this. do that

#

well, you need to do the math properly

grim zodiac
#

yes, but how do I then set that value of that device (or the devices entity?)

languid smelt
#

you don't set values of devices

grim zodiac
#

I need to update the external temperature-whatever it is..

languid smelt
#

you use service calls/actions

grim zodiac
#

ok

languid smelt
#

if the integration exposes a number entity as a way to change a value for a particular device, use the number.set_value action in the same way as I showed above

grim zodiac
#

ah ok, so the device should have >something< like input_number.temp_toilet_stuen that I can update - pretty new to HA, so have patience πŸ™‚

languid smelt
#

Yes, it will be number.xxxx and you can find it on the device page by clicking on the entity and then clicking on the configuration

#

device actions are annoying for many reasons, but even more so when they do things like entity_id: ea4ba049fbb95513a6fcae3021ba7947 to make it impossible to know what the actual entity_id is

grim zodiac
#

yeah it gets messy with many of those zigbee devices - im using zigbee2mqtt for most of my devices

languid smelt
#

once you know what the entity is, call number.set_value on it and never use device actions again

#

they are of no value and are limited in what they can do

grim zodiac
#

got it now I think πŸ˜„

#
alias: TempToiletUpdateInputNumber
sequence:
  - action: input_number.set_value
    metadata: {}
    data:
      value: "{{ states('sensor.sensortvoctoiletstue_temperature') |float(8)*100 }}"
    target:
      entity_id: number.danfossallystuentoilet_external_measured_room_sensor
description: ""
icon: mdi:temperature-celsius
languid smelt
#

you need the action and entity to match

#

you need to use number.set_value

grim zodiac
#

ah yes

#

thank you so much for your help - and explaining HA better to me! πŸ™‚

languid smelt