Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102998

Updated Home assistant and now math using int not working

$
0
0

I just updated my home assistant and now it appears to not like my Modbus math templates. The file check works but in HA the test fails showing it doesn’t like my data type. I did try adding int32 instead of int to everything and it did work but the result was in the millions. What do I need to do to correct this issue?

modbus: 
  - name: hub1
    type: tcp
    host: 192.168.1.24    
    port: 502

    switches:
      - name: Pool Pump
        slave: 255
        address: 3199
        write_type: coil
        verify:
        
      - name: Yard Light
        slave: 255
        address: 3294
        write_type: coil
        verify:
    
      - name: Deck Lights
        slave: 255
        address: 3296
        write_type: coil
        verify:

    binary_sensors:
      - name: "Pump State"
        address: 2052
        scan_interval: 10
        slave: 255
        device_class: moving
        input_type: coil   
       
    sensors:
      - name: Pool Temphex
        address: 1024
        scan_interval: 10
        slave: 255       
        data_type: int # int or float
        unit_of_measurement: "°F"
        
      - name: outside Temphex
        address: 1026
        scan_interval: 10
        slave: 255       
        data_type: int # int or float
        unit_of_measurement: "°F"        
        
        
template:
  - sensor:
      - name: "Pool Temp"
        unit_of_measurement: "°F"
        state: '{{ ("%0x" % (states("sensor.pool_temphex") | int)) | int / 10 }}'

      - name: "Outside Temp"
        unit_of_measurement: "°F"
        state: '{{ ("%0x" % (states("sensor.outside_temphex") | int)) | int / 10 }}'

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 102998

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>