Modbus Sensor calculate income value

Hi,

i´m newbie in Homeassistant and yaml
if have Modbus TCP Sensors wich must be calculate after reading

value - 600 then devide 10

  • name: ecs_cellt_1
    unique_id: ecs_cellt_1
    slave: 1
    address: 8
    offset: -600
    scale: 0.1
    precision: 1
    input_type: holding
    data_type: int16
    scan_interval: 60
    unit_of_measurement: °C

the offset and scale does it in wrong sequence

how can i use a variable vor scan_interval

The scale and offset are performed in the sequence described in the documentation. If you want to perform different operations on the incoming value, you’ll have to create a template sensor. I’d suggest doing the offset in the modbus config and then creating a template sensor to scale it.

The scan_interval must be a fixed number, so what you can do instead is set a very long time (months or years) and then create an automation that fires on whatever interval our trigger you want, and calls the update_entity service

Also, in the future please format your code properly. See item #11 in this post.

thank you

thougth i´ve choose the right qoute