# # modbus sensors for EPEver
# - platform: mqtt
# ## reg 3100
#   state_topic: "tracer/sensor/tracer_1_pv_array_voltage"
#   unique_id: "array_voltage"
#   name: "solar_PV_Voltage"
#   device_class: voltage
#   unit_of_measurement: 'V'
#   state_class: measurement
#   value_template: "{{ value | round(12) }}"
  
# - platform: mqtt
# ## reg 3101
#   state_topic: "tracer/sensor/tracer_1_pv_array_current"
#   unique_id: "array_current"
#   name: "solar_PV_Current"
#   device_class: current
#   unit_of_measurement: 'A'
#   state_class: measurement
#   value_template: "{{ value | round(2) }}"
  
# - platform: mqtt
# ## reg 3102 3103
#   state_topic: "tracer/sensor/tracer_1_pv_array_power"
#   unique_id: "array_power"
#   name: "solar_PV_Power"
#   icon: mdi:solar-power
#   device_class: power
#   unit_of_measurement: 'W'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"
  
# - platform: mqtt
# ## reg 3104
#   state_topic: "tracer/sensor/tracer_1_battery_voltage"
#   unique_id: "battery_voltage"
#   name: "solar_Battery_Voltage"
#   device_class: voltage
#   unit_of_measurement: 'V'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"
# - platform: mqtt
# ##reg 3105
#   state_topic: "tracer/sensor/tracer_1_battery_charging_current"
#   name: "Battery_charging_Current"
#   unique_id: "battery_charging_current"
#   device_class: current
#   unit_of_measurement: 'A'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"  
  
    
# - platform: mqtt
# #reg 3302
#   state_topic: "tracer/sensor/tracer_1_max_battery_voltage_today"
#   name: "solar_Battery_Max_Voltage"
#   device_class: voltage
#   unit_of_measurement: 'V'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"
  
# - platform: mqtt
# #reg 3303
#   state_topic: "tracer/sensor/tracer_1_min_battery_voltage_today"
#   name: "solar_Battery_Min_Voltage"
#   device_class: voltage
#   unit_of_measurement: 'V'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"

# - platform: mqtt
# ##reg 331B-331C
#   state_topic: "tracer/sensor/tracer_1_net_battery_current"
#   name: "net_Battery_Current"
#   unique_id: "net_battery_current"
#   device_class: current
#   unit_of_measurement: 'A'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"
  
# - platform: mqtt
#   state_topic: "tracer/registers/Charging equipment output power/value"
#   unique_id: "battery_power"
#   name: "solar_Battery_Power"
#   device_class: power
#   unit_of_measurement: 'W'
#   state_class: measurement
#   value_template: "{{ value | round(1) }}"
  
# - platform: mqtt
# #reg 3110
#   state_topic: "tracer/sensor/tracer_1_battery_temperature"
#   name: "solar_Battery_Temperature"
#   unique_id: "battery_temperature"
#   icon: mdi:thermometer
#   device_class: temperature
#   state_class: measurement
#   unit_of_measurement: '°C'
#   value_template: "{{ value | round(1) }}"
  
# - platform: mqtt
# #reg 311A
#   state_topic: "tracer/sensor/tracer_1_battery_soc"
#   name: "solar_Battery_SOC"
#   unique_id: "battery_SOC"
#   unit_of_measurement: '%'
#   value_template: "{{ value | round(1) }}"
  
# - platform: mqtt
# #reg 3111
#   state_topic: "tracer/sensor/tracer_1_charger_temperature"
#   unique_id: "device_temperature"
#   name: "solar_device_Temperature"
#   device_class: temperature
#   state_class: measurement
#   unit_of_measurement: '°C'
#   value_template: "{{ value | round(1) }}"
  


# - platform: mqtt
# ## reg 3201
#   state_topic: "tracer/sensor/tracer_1_equipment_status"
#   name: "solar_PV_Status"
#   unique_id: "solar_PV_status"
#  # device_class: energy
#   #unit_of_measurement: 'kW'
#   value_template: "{{ value  }}" 
  
# - platform: mqtt
# ## reg 3200
#   state_topic: "tracer/sensor/tracer_1_battery_status"
#   name: "solar_battery_Status"
#   unique_id: "battery_status"
#   value_template: "{{ value }}" 
  
# - platform: mqtt
# ## reg  330C-330D
#   state_topic: "tracer/sensor/tracer_1_generated_energy_today"
#   name: "generated_Today_Energy"
#   unique_id: "generated_energy_today"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"
  
# - platform: mqtt
# ##reg 330A-330B
#   state_topic: "tracer/sensor/tracer_1_total_generated_energy"
#   unique_id: "generated_energy_total"
#   name: "generated_total_Energy"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"

# - platform: mqtt
# ## reg  330E-330F
#   state_topic: "tracer/sensor/tracer_1_generated_energy_this_month"
#   name: "generated_month_Energy"
#   unique_id: "generated_energy_month"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"
  
# - platform: mqtt
# ##reg 330A-330B
#   state_topic: "tracer/sensor/tracer_1_generated_energy_this_year"
#   unique_id: "generated_energy_year"
#   name: "generated_year_Energy"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"

# - platform: mqtt
# ##reg  310E-310F
#   state_topic: "tracer/sensor/tracer_1_load_power"
#   unique_id: "load power"
#   name: "DC_Load_Power"
#   device_class: power
#   unit_of_measurement: 'W'
#   state_class: measurement
#   value_template: "{{ value | round(2) }}"
  
# - platform: mqtt
# ## reg 310C
#   state_topic: "tracer/sensor/tracer_1_load_voltage"
#   name: "DC_Load_Voltage"
#   unique_id: "load voltage"
#   device_class: voltage
#   unit_of_measurement: 'V'
#   state_class: measurement
#   value_template: "{{ value | round(2) }}"
  
# - platform: mqtt
# ## reg 310D
#   state_topic: "tracer/sensor/tracer_1_load_current"
#   name: "DC_Load_Courant"
#   unique_id: "load current"
#   device_class: current
#   unit_of_measurement: 'A'
#   state_class: measurement
#   value_template: "{{ value | round(2) }}"
 
# - platform: mqtt
# ## reg  200C
#   state_topic: "tracer/sensor/tracer_1_day/night"
#   name: "solar_Day_Night"
#   #device_class: energy
#   #unit_of_measurement: 'kW'
#   value_template: "{{ value  }}"

# - platform: mqtt
# ## reg  330C-330D
#   state_topic: "tracer/sensor/tracer_1_consumed_energy_today"
#   name: "consumed_Today_Energy"
#   unique_id: "energy_today"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"
  
# - platform: mqtt
# ##reg 330A-330B
#   state_topic: "tracer/sensor/tracer_1_total_consumed_energy"
#   unique_id: "consumed_energy_total"
#   name: "consumed_Total_Energy"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"



# - platform: mqtt
# ##reg 330A-330B
#   state_topic: "tracer/sensor/tracer_1_consumed_energy_this_month"
#   unique_id: "consumed_energy_month"
#   name: "consumed_Month_Energy"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"

# - platform: mqtt
# ##reg 330A-330B
#   state_topic: "tracer/sensor/tracer_1_consumed_energy_this_year"
#   unique_id: "consumed_energy_year"
#   name: "consumed_Year_Energy"
#   device_class: energy
#   state_class: total_increasing
#   unit_of_measurement: 'kWh'
#   value_template: "{{ value | round(2) }}"

# - platform: mqtt
# ## reg 3201
#   state_topic: "tracer/sensor/tracer_1_charging_mode"
#   name: "charging mode"
#   unique_id: "charging mode"
#  # device_class: energy
#   #unit_of_measurement: 'kW'
#   value_template: "{{ value | round(1) }}"   


# - platform: mqtt
# ## reg 3201
#   state_topic: "arduinomegatest/servo/status"
#   name: "servo_pos"
#   unique_id: "servo_pos1"
#  # device_class: energy
#   #unit_of_measurement: 'kW'
#  # value_template: "{{ value }}"  