alias: set_gree_lower_at_heat
description: When slider value changes writes to a modbus register
trigger:
- platform: state
entity_id:
- input_number.gree_lower_at_heat
condition: []
action:
- service: modbus.write_register
data:
hub: versati3
address: 18
slave: 1
value: "{{ 65536 + states('input_number.gree_lower_at_heat') | int }}"
mode: single
What it does, is sending a value from a numeric slider over Modbus. The problem is:
One cannot send negative values, thus, I am twos complementing the value,
This will work only for negative values, as there is no roll over mechanism for 16-bit values.
What I need is a condition, which would add the 65536 only if the input_number.gree_lower_at_heat is lower than 0. I don’t know how to achieve that in terms of HA syntax in the value: field.
I would appreciate all feedback, also for better solutions!