I have some problem with casting in templates. I try to set LEVEL parameter of my Homematic IP TRV. To achieve that I use following automation:
automation:
- alias: Set living room valve state
trigger:
platform: state
entity_id: input_number.valve_livingroom
action:
- service: homematic.put_paramset
data_template:
interface: hmip
address: 0000000000:1 # Example address
paramset_key: VALUES
paramset:
LEVEL: "{{ states('input_number.valve_livingroom') | float }}"
Unfortunately value of LEVEL parameter is passed as string not as float and homematic integration does not support string as input type:
2020-07-31 20:40:50 DEBUG (SyncWorker_8) [homeassistant.components.homematic] Calling putParamset: hmip, 0000000000:1, VALUES, {'LEVEL': '0.52'}
2020-07-31 20:40:50 DEBUG (SyncWorker_8) [pyhomematic._hm] ServerThread.putParamset: Exception: <Fault -5: 'Invalid parameter or value'>
Everything is working perfectly fine if I directly pass float value:
paramset:
LEVEL: 0.82
2020-07-31 20:54:35 DEBUG (SyncWorker_2) [homeassistant.components.homematic] Calling putParamset: hmip, 0000000000:1, VALUES, {'LEVEL': 0.82}
Is this a bug or expected behavior?