diff --git a/templates/sofar.yaml b/templates/sofar.yaml index 5749abeca..0c29b1568 100644 --- a/templates/sofar.yaml +++ b/templates/sofar.yaml @@ -1,352 +1,352 @@ -# ------------------------------------------------------------------ -# Sofar Config -# ------------------------------------------------------------------ ---- -pred_bat: - module: predbat - class: PredBat - - # Sets the prefix for all created entities in HA - only change if you want to run more than once instance - prefix: predbat - - # Timezone to work in - timezone: Europe/London - - # XXX: Template configuration, delete this line once you have set up for your system - template: True - - # If you are using Predbat outside of HA then set the HA URL and Key (long lived access token here) - #ha_url: 'http://homeassistant.local:8123' - #ha_key: 'xxx' - - # Currency, symbol for main currency second symbol for 1/100s e.g. $ c or £ p or e c - currency_symbols: - - '£' - - 'p' - - # Number of threads to use in plan calculation - # Can be auto for automatic, 0 for off or values 1-N for a fixed number - threads: auto - - # - # Sensors, more than one can be specified and they will be summed up automatically - # - # For two inverters the load today would normally be the master load sensor only (to cover the entire house) - # If you have three phase and one inverter per phase then you would need three load sensors - # - # For pv_today if you have multiple solar inverter inputs then you should include one entry for each inverter - # - load_today: - - sensor.sofar_energy_today_consumption - import_today: - - sensor.sofar_energy_today_purchase - export_today: - - sensor.sofar_energy_today_exported - pv_today: - - sensor.sofar_energy_today_generation - - # Load forecast can be used to add to the historical load data (heat-pump) - # To link to Predheat - # Data must be in the format of 'last_updated' timestamp and 'energy' for incrementing kWh - #load_forecast: - # - predheat.heat_energy$external - # - num_inverters: 1 - inverter_type: "SF" - # - battery_power: - - sensor.sofar_inverter_battery_power - pv_power: - - sensor.sofar_solar_power - load_power: - - sensor.sofar_house_consumption_power - soc_kw: - - sensor.sofar_battery_energy - soc_max: - - input_number.sofar_battery_max_charge - charge_limit: - - 100 - reserve: - - 20 - scheduled_charge_enable: - - off - scheduled_discharge_enable: - - off - charge_start_time: - - "00:00:00" - charge_end_time: - - "00:01:00" - discharge_start_time: - - "00:00:00" - discharge_end_time: - - "00:01:00" - - # Inverter max AC limit (one per inverter). E.g for a 3.6kw inverter set to 3600 - # If you have a second inverter for PV only please add the two values together - inverter_limit: - - 5000 - - # Set the maximum charge/discharge rate of the battery - battery_rate_max: - - 3000 - - # Export limit is a software limit set on your inverter that prevents exporting above a given level - # When enabled Predbat will model this limit - #export_limit: - # - 3600 - - # Some inverters don't turn off when the rate is set to 0, still charge or discharge at around 200w - # The value can be set here in watts to model this (doesn't change operation) - #inverter_battery_rate_min: - # - 200 - - # Workaround to limit the maximum reserve setting, some inverters won't allow 100% to be set - # inverter_reserve_max : 99 - - # Some batteries tail off their charge rate at high soc% - # enter the charging curve here as a % of the max charge rate for each soc percentage. - # the default is 1.0 (full power) - # The example below is from GE 9.5kwh battery with latest firmware and gen1 inverter - #battery_charge_power_curve: - # 91 : 0.91 - # 92 : 0.81 - # 93 : 0.71 - # 94 : 0.62 - # 95 : 0.52 - # 96 : 0.43 - # 97 : 0.33 - # 98 : 0.24 - # 99 : 0.24 - # 100 : 0.24 - - # Inverter clock skew in minutes, e.g. 1 means it's 1 minute fast and -1 is 1 minute slow - # Separate start and end options are applied to the start and end time windows, mostly as you want to start late (not early) and finish early (not late) - # Separate discharge skew for discharge windows only - inverter_clock_skew_start: 0 - inverter_clock_skew_end: 0 - inverter_clock_skew_discharge_start: 0 - inverter_clock_skew_discharge_end: 0 - - # Clock skew adjusts the Appdaemon time - # This is the time that Predbat takes actions like starting discharge/charging - # Only use this for workarounds if your inverter time is correct but Predbat is somehow wrong (AppDaemon issue) - # 1 means add 1 minute to AppDaemon time, -1 takes it away - clock_skew: 0 - - # Solcast cloud interface, set this or the local interface below - #solcast_host: 'https://api.solcast.com.au/' - #solcast_api_key: 'xxxx' - #solcast_poll_hours: 8 - - # Set these to match solcast sensor names if not using the cloud interface - # The regular expression (re:) makes the solcast bit optional - # If these don't match find your own names in Home Assistant - pv_forecast_today: re:(sensor.(solcast_|)(pv_forecast_|)forecast_today) - pv_forecast_tomorrow: re:(sensor.(solcast_|)(pv_forecast_|)forecast_tomorrow) - pv_forecast_d3: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_3|d3)) - pv_forecast_d4: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_4|d4)) - - # car_charging_energy defines an incrementing sensor which measures the charge added to your car - # is used for car_charging_hold feature to filter out car charging from the previous load data - # Automatically set to detect Wallbox and Zappi, if it doesn't match manually enter your sensor name - # Also adjust car_charging_energy_scale if it's not in kwH to fix the units - car_charging_energy: 're:(sensor.myenergi_zappi_[0-9a-z]+_charge_added_session|sensor.wallbox_portal_added_energy)' - - # car_charging_power is the live charging power of your car charger, in Watts - # It is display only - it drives the car shown on the web interface power flow diagram - # and the predbat.car_charging_power sensor. The plan itself is unaffected by it. - # Automatically set to detect Wallbox and Zappi, if it doesn't match manually enter your sensor name - car_charging_power: 're:(sensor.myenergi_zappi_[0-9a-z]+_internal_load_ct1|sensor.wallbox_portal_charging_power)' - - # Defines the number of cars modelled by the system, set to 0 for no car - num_cars: 0 - - # car_charging_planned is set to a sensor which when positive indicates the car will charged in the upcoming low rate slots - # This should not be needed if you use Intelligent Octopus slots which will take priority if enabled - # The list of possible values is in car_charging_planned_response - # Auto matches Zappi and Wallbox, or change it for your own - # One entry per car - car_charging_planned: - - 're:(sensor.wallbox_portal_status_description|sensor.myenergi_zappi_[0-9a-z]+_plug_status)' - - car_charging_planned_response: - - 'yes' - - 'on' - - 'true' - - 'connected' - - 'ev connected' - - 'ev ready to charge' - - 'charging' - - 'paused' - - 'waiting for car demand' - - 'waiting for ev' - - 'scheduled' - - 'enabled' - - 'latched' - - 'locked' - - 'plugged in' - - # car_charging_now can be set to a sensor that shows the car is charging right now, so that - # Predbat holds the house battery for the car while it charges. It never adds a charging slot. - # Use an on/off sensor (matched against car_charging_now_response), or a charging power sensor - # in W or kW where 200W or more counts as charging - e.g. for a Wallbox charger: - #car_charging_now: - # - sensor.wallbox_portal_charging_power - - # Positive responses for car_charging_now - car_charging_now_response: - - 'yes' - - 'on' - - 'true' - - # To make planned car charging more accurate, either using car_charging_planned or the Octopus Energy plugin, - # specify your battery size in kwh, charge limit % and current car battery soc % sensors/values. - # If you have Intelligent Octopus the battery size and limit will be extracted from the Octopus Energy plugin directly. - # Set the car SoC% if you have it to give an accurate forecast of the cars battery levels. - # One entry per car if you have multiple cars. - #car_charging_battery_size: - # - 75 - #car_charging_limit: - # - 're:number.tsunami_charge_limit' - #car_charging_soc: - # - 're:sensor.tsunami_battery' - - # If you have Octopus Intelligent Go and are not using the Octopus Direct connection method, enable the intelligent slot information to add to pricing - # Will automatically disable if not found, or comment out to disable fully - # When enabled it overrides the 'car_charging_planned' feature and predict the car charging based on the intelligent plan (unless Octopus intelligent charging is False) - # This matches the intelligent slot from the Octopus Energy integration - octopus_intelligent_slot: 're:(binary_sensor.octopus_energy([0-9a-z_]+|)_intelligent_dispatching)' - octopus_ready_time: 're:((select|time).octopus_energy_([0-9a-z_]+|)_intelligent_target_time)' - octopus_charge_limit: 're:(number.octopus_energy([0-9a-z_]+|)_intelligent_charge_target)' - - # Example alternative configuration for Ohme integration release >=v0.6.1 - #octopus_intelligent_slot: 'binary_sensor.ohme_slot_active' - #octopus_ready_time: 'time.ohme_target_time' - #octopus_charge_limit: 'number.ohme_target_percent' - - # Set this to False if you use Octopus Intelligent slot for car planning but when on another tariff e.g. Agile - #octopus_slot_low_rate: False - - # Carbon Intensity data from National grid - # carbon_postcode: 'SW1 5NA' - # carbon_automatic: True - - # Octopus saving session points to the saving session Sensor in the Octopus plugin, when enabled saving sessions will be at the assumed - # rate configured with input_number.predbat_metric_octopus_saving_rate in-side HA - octopus_saving_session: 're:(event.octopus_energy([0-9a-z_]+|)_(saving_session_events?|power_down_events))' - octopus_saving_session_octopoints_per_penny: 8 - # Minimum octopoints_per_kwh an available saving session must offer for Predbat to auto-join it (default 0, joins any non-negative reward). - octopus_saving_session_min_octopoints_per_kwh: 0 - - # Octopus free session points to the free session Sensor in the Octopus plugin - # Note: You must enable this event sensor in the Octopus Integration in Home Assistant for it to work - octopus_free_session: 're:(event.octopus_energy_([0-9a-z_]+|)_octoplus_(free_electricity_session_events|power_up_events))' - - # Energy rates - # Please set one of these three, if multiple are set then Octopus is used first, second rates_import/rates_export and latest basic metric - - # Set import and export entity to point to the Octopus Energy plugin import and export sensors - # automatically matches your meter number assuming you have only one (no need to edit the below) - # Will be ignored if you don't have the sensor but will error if you do have one and it's incorrect - # Note: To get detailed energy rates you need to go in and manually enable the following events in HA - # event.octopus_energy_electricity_xxxxxxxx_previous_day_rates - # event.octopus_energy_electricity_xxxxxxxx_current_day_rates - # event.octopus_energy_electricity_xxxxxxxx_next_day_rates - # and if you have export enable: - # event.octopus_energy_electricity_xxxxxxxx_export_previous_day_rates - # event.octopus_energy_electricity_xxxxxxxx_export_current_day_rates - # event.octopus_energy_electricity_xxxxxxxx_export_next_day_rates - # Predbat will automatically find the event. entities from the link below to the sensors - metric_octopus_import: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)' - # metric_octopus_export: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_export_current_rate)' - - # Standing charge in pounds, can be set to a sensor or manually entered (e.g. 0.50 is 50p) - # The default below will pick up the standing charge from the Octopus Plugin - # The standing charge only impacts the cost graphs and doesn't change the way Predbat plans - # If you don't want to show the standing charge then just delete this line or set to zero - metric_standing_charge: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge)' - - # Or set your actual rates across time for import and export - # If start/end is missing it's assumed to be a fixed rate - # Gaps are filled with zero rate - #rates_import: - # - start: "00:30:00" - # end: "04:30:00" - # rate: 7.5 - # - start: "04:30:00" - # end: "00:30:00" - # rate: 40.0 - # - rates_export: - - rate: 0 - - # Can be used instead of the plugin to get import rates directly online - # Overrides metric_octopus_import and rates_import - # See the 'energy rates' part of the documentation for instructions on how to find the correct URL for your tariff and DNO region - # - # rates_import_octopus_url : "https://api.octopus.energy/v1/products/FLUX-IMPORT-23-02-14/electricity-tariffs/E-1R-FLUX-IMPORT-23-02-14-A/standard-unit-rates" - # rates_import_octopus_url : "https://api.octopus.energy/v1/products/AGILE-24-10-01/electricity-tariffs/E-1R-AGILE-24-10-01-A/standard-unit-rates" - - # Overrides metric_octopus_export and rates_export - # rates_export_octopus_url: "https://api.octopus.energy/v1/products/FLUX-EXPORT-23-02-14/electricity-tariffs/E-1R-FLUX-EXPORT-23-02-14-A/standard-unit-rates" - # rates_export_octopus_url: "https://api.octopus.energy/v1/products/AGILE-OUTGOING-19-05-13/electricity-tariffs/E-1R-AGILE-OUTGOING-19-05-13-A/standard-unit-rates/" - - # Import rates can be overridden with rate_import_override - # Export rates can be overridden with rate_export_override - # Use the same format as above, but a date can be included if it just applies for a set day (e.g. Octopus power ups) - # This will override even the Octopus plugin rates if enabled - # - #rates_import_override: - # - date: '2023-09-10' - # start: '14:00:00' - # end: '14:30:00' - # rate: 5 - - # Days previous sets how many days of load history Predbat searches when forecasting your future house load. - # By default this uses a weighted-bucket forecast that automatically accounts for day-of-week, holiday mode - # and recency (days_previous_auto) - see the documentation for other options, such as picking specific - # days/weights instead, or using Load ML. - days_previous: - - 7 - - # Number of hours forward to forecast, best left as-is unless you have specific reason - forecast_hours: 48 - - # Specify the devices that notifies are sent to, the default is 'notify' which goes to all - #notify_devices: - # - mobile_app_treforsiphone12_2 - - # Battery scaling makes the battery smaller (e.g. 0.9) or bigger than its reported - # If you have an 80% DoD battery that falsely reports it's kwh then set it to 0.8 to report the real figures - battery_scaling: 1.0 - - # Can be used to scale import and export data, used for workarounds - import_export_scaling: 1.0 - - # Export triggers: - # For each trigger give a name, the minutes of export needed and the energy required in that time - # Multiple triggers can be set at once so in total you could use too much energy if all run - # Creates an entity called 'binary_sensor.predbat_export_trigger_' which will be turned On when the condition is valid - # connect this to your automation to start whatever you want to trigger - export_triggers: - - name: 'large' - minutes: 60 - energy: 1.0 - - name: 'small' - minutes: 15 - energy: 0.25 - - # If you have a sensor that gives the energy consumed by your solar diverter then add it here - # this will make the predictions more accurate. It should be an incrementing sensor, it can reset at midnight or not - # It's assumed to be in Kwh but scaling can be applied if need be - #iboost_energy_today: 'sensor.tasmota_energy_today' - #iboost_energy_scaling: 1.0 - - # Nordpool market energy rates - #futurerate_url: 'https://dataportal-api.nordpoolgroup.com/api/DayAheadPrices?date=DATE&market=N2EX_DayAhead&deliveryArea=UK¤cy=GBP' - #futurerate_adjust_import: False - #futurerate_adjust_export: True - #futurerate_peak_start: "16:00:00" - #futurerate_peak_end: "19:00:00" - #futurerate_peak_premium_import: 14 - #futurerate_peak_premium_export: 6.5 +# ------------------------------------------------------------------ +# Sofar Config +# ------------------------------------------------------------------ +--- +pred_bat: + module: predbat + class: PredBat + + # Sets the prefix for all created entities in HA - only change if you want to run more than once instance + prefix: predbat + + # Timezone to work in + timezone: Europe/London + + # XXX: Template configuration, delete this line once you have set up for your system + template: True + + # If you are using Predbat outside of HA then set the HA URL and Key (long lived access token here) + #ha_url: 'http://homeassistant.local:8123' + #ha_key: 'xxx' + + # Currency, symbol for main currency second symbol for 1/100s e.g. $ c or £ p or e c + currency_symbols: + - '£' + - 'p' + + # Number of threads to use in plan calculation + # Can be auto for automatic, 0 for off or values 1-N for a fixed number + threads: auto + + # + # Sensors, more than one can be specified and they will be summed up automatically + # + # For two inverters the load today would normally be the master load sensor only (to cover the entire house) + # If you have three phase and one inverter per phase then you would need three load sensors + # + # For pv_today if you have multiple solar inverter inputs then you should include one entry for each inverter + # + load_today: + - sensor.sofar_energy_today_consumption + import_today: + - sensor.sofar_energy_today_purchase + export_today: + - sensor.sofar_energy_today_exported + pv_today: + - sensor.sofar_energy_today_generation + + # Load forecast can be used to add to the historical load data (heat-pump) + # To link to Predheat + # Data must be in the format of 'last_updated' timestamp and 'energy' for incrementing kWh + #load_forecast: + # - predheat.heat_energy$external + # + num_inverters: 1 + inverter_type: "SF" + # + battery_power: + - sensor.sofar_inverter_battery_power + pv_power: + - sensor.sofar_solar_power + load_power: + - sensor.sofar_house_consumption_power + soc_kw: + - sensor.sofar_battery_energy + soc_max: + - input_number.sofar_battery_max_charge + charge_limit: + - 100 + reserve: + - 20 + scheduled_charge_enable: + - off + scheduled_discharge_enable: + - off + charge_start_time: + - "00:00:00" + charge_end_time: + - "00:01:00" + discharge_start_time: + - "00:00:00" + discharge_end_time: + - "00:01:00" + + # Inverter max AC limit (one per inverter). E.g for a 3.6kw inverter set to 3600 + # If you have a second inverter for PV only please add the two values together + inverter_limit: + - 5000 + + # Set the maximum charge/discharge rate of the battery + battery_rate_max: + - 3000 + + # Export limit is a software limit set on your inverter that prevents exporting above a given level + # When enabled Predbat will model this limit + #export_limit: + # - 3600 + + # Some inverters don't turn off when the rate is set to 0, still charge or discharge at around 200w + # The value can be set here in watts to model this (doesn't change operation) + #inverter_battery_rate_min: + # - 200 + + # Workaround to limit the maximum reserve setting, some inverters won't allow 100% to be set + # inverter_reserve_max : 99 + + # Some batteries tail off their charge rate at high soc% + # enter the charging curve here as a % of the max charge rate for each soc percentage. + # the default is 1.0 (full power) + # The example below is from GE 9.5kwh battery with latest firmware and gen1 inverter + #battery_charge_power_curve: + # 91 : 0.91 + # 92 : 0.81 + # 93 : 0.71 + # 94 : 0.62 + # 95 : 0.52 + # 96 : 0.43 + # 97 : 0.33 + # 98 : 0.24 + # 99 : 0.24 + # 100 : 0.24 + + # Inverter clock skew in minutes, e.g. 1 means it's 1 minute fast and -1 is 1 minute slow + # Separate start and end options are applied to the start and end time windows, mostly as you want to start late (not early) and finish early (not late) + # Separate discharge skew for discharge windows only + inverter_clock_skew_start: 0 + inverter_clock_skew_end: 0 + inverter_clock_skew_discharge_start: 0 + inverter_clock_skew_discharge_end: 0 + + # Clock skew adjusts the Appdaemon time + # This is the time that Predbat takes actions like starting discharge/charging + # Only use this for workarounds if your inverter time is correct but Predbat is somehow wrong (AppDaemon issue) + # 1 means add 1 minute to AppDaemon time, -1 takes it away + clock_skew: 0 + + # Solcast cloud interface, set this or the local interface below + #solcast_host: 'https://api.solcast.com.au/' + #solcast_api_key: 'xxxx' + #solcast_poll_hours: 8 + + # Set these to match solcast sensor names if not using the cloud interface + # The regular expression (re:) makes the solcast bit optional + # If these don't match find your own names in Home Assistant + pv_forecast_today: re:(sensor.(solcast_|)(pv_forecast_|)forecast_today) + pv_forecast_tomorrow: re:(sensor.(solcast_|)(pv_forecast_|)forecast_tomorrow) + pv_forecast_d3: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_3|d3)) + pv_forecast_d4: re:(sensor.(solcast_|)(pv_forecast_|)forecast_(day_4|d4)) + + # car_charging_energy defines an incrementing sensor which measures the charge added to your car + # is used for car_charging_hold feature to filter out car charging from the previous load data + # Automatically set to detect Wallbox and Zappi, if it doesn't match manually enter your sensor name + # Also adjust car_charging_energy_scale if it's not in kwH to fix the units + car_charging_energy: 're:(sensor.myenergi_zappi_[0-9a-z]+_charge_added_session|sensor.wallbox_portal_added_energy)' + + # car_charging_power is the live charging power of your car charger, in Watts + # It is display only - it drives the car shown on the web interface power flow diagram + # and the predbat.car_charging_power sensor. The plan itself is unaffected by it. + # Automatically set to detect Wallbox and Zappi, if it doesn't match manually enter your sensor name + car_charging_power: 're:(sensor.myenergi_zappi_[0-9a-z]+_internal_load_ct1|sensor.wallbox_portal_charging_power)' + + # Defines the number of cars modelled by the system, set to 0 for no car + num_cars: 0 + + # car_charging_planned is set to a sensor which when positive indicates the car will charged in the upcoming low rate slots + # This should not be needed if you use Intelligent Octopus slots which will take priority if enabled + # The list of possible values is in car_charging_planned_response + # Auto matches Zappi and Wallbox, or change it for your own + # One entry per car + car_charging_planned: + - 're:(sensor.wallbox_portal_status_description|sensor.myenergi_zappi_[0-9a-z]+_plug_status)' + + car_charging_planned_response: + - 'yes' + - 'on' + - 'true' + - 'connected' + - 'ev connected' + - 'ev ready to charge' + - 'charging' + - 'paused' + - 'waiting for car demand' + - 'waiting for ev' + - 'scheduled' + - 'enabled' + - 'latched' + - 'locked' + - 'plugged in' + + # car_charging_now can be set to a sensor that shows the car is charging right now, so that + # Predbat holds the house battery for the car while it charges. It never adds a charging slot. + # Use an on/off sensor (matched against car_charging_now_response), or a charging power sensor + # in W or kW where 200W or more counts as charging - e.g. for a Wallbox charger: + #car_charging_now: + # - sensor.wallbox_portal_charging_power + + # Positive responses for car_charging_now + car_charging_now_response: + - 'yes' + - 'on' + - 'true' + + # To make planned car charging more accurate, either using car_charging_planned or the Octopus Energy plugin, + # specify your battery size in kwh, charge limit % and current car battery soc % sensors/values. + # If you have Intelligent Octopus the battery size and limit will be extracted from the Octopus Energy plugin directly. + # Set the car SoC% if you have it to give an accurate forecast of the cars battery levels. + # One entry per car if you have multiple cars. + #car_charging_battery_size: + # - 75 + #car_charging_limit: + # - 're:number.tsunami_charge_limit' + #car_charging_soc: + # - 're:sensor.tsunami_battery' + + # If you have Octopus Intelligent Go and are not using the Octopus Direct connection method, enable the intelligent slot information to add to pricing + # Will automatically disable if not found, or comment out to disable fully + # When enabled it overrides the 'car_charging_planned' feature and predict the car charging based on the intelligent plan (unless Octopus intelligent charging is False) + # This matches the intelligent slot from the Octopus Energy integration + octopus_intelligent_slot: 're:(binary_sensor.octopus_energy([0-9a-z_]+|)_intelligent_dispatching)' + octopus_ready_time: 're:((select|time).octopus_energy_([0-9a-z_]+|)_intelligent_target_time)' + octopus_charge_limit: 're:(number.octopus_energy([0-9a-z_]+|)_intelligent_charge_target)' + + # Example alternative configuration for Ohme integration release >=v0.6.1 + #octopus_intelligent_slot: 'binary_sensor.ohme_slot_active' + #octopus_ready_time: 'time.ohme_target_time' + #octopus_charge_limit: 'number.ohme_target_percent' + + # Set this to False if you use Octopus Intelligent slot for car planning but when on another tariff e.g. Agile + #octopus_slot_low_rate: False + + # Carbon Intensity data from National grid + # carbon_postcode: 'SW1 5NA' + # carbon_automatic: True + + # Octopus saving session points to the saving session Sensor in the Octopus plugin, when enabled saving sessions will be at the assumed + # rate configured with input_number.predbat_metric_octopus_saving_rate in-side HA + octopus_saving_session: 're:(event.octopus_energy([0-9a-z_]+|)_(saving_session_events?|power_down_events))' + octopus_saving_session_octopoints_per_penny: 8 + # Minimum octopoints_per_kwh an available saving session must offer for Predbat to auto-join it (default 0, joins any non-negative reward). + octopus_saving_session_min_octopoints_per_kwh: 0 + + # Octopus free session points to the free session Sensor in the Octopus plugin + # Note: You must enable this event sensor in the Octopus Integration in Home Assistant for it to work + octopus_free_session: 're:(event.octopus_energy_([0-9a-z_]+|)_octoplus_(free_electricity_session_events|power_up_events))' + + # Energy rates + # Please set one of these three, if multiple are set then Octopus is used first, second rates_import/rates_export and latest basic metric + + # Set import and export entity to point to the Octopus Energy plugin import and export sensors + # automatically matches your meter number assuming you have only one (no need to edit the below) + # Will be ignored if you don't have the sensor but will error if you do have one and it's incorrect + # Note: To get detailed energy rates you need to go in and manually enable the following events in HA + # event.octopus_energy_electricity_xxxxxxxx_previous_day_rates + # event.octopus_energy_electricity_xxxxxxxx_current_day_rates + # event.octopus_energy_electricity_xxxxxxxx_next_day_rates + # and if you have export enable: + # event.octopus_energy_electricity_xxxxxxxx_export_previous_day_rates + # event.octopus_energy_electricity_xxxxxxxx_export_current_day_rates + # event.octopus_energy_electricity_xxxxxxxx_export_next_day_rates + # Predbat will automatically find the event. entities from the link below to the sensors + metric_octopus_import: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)' + # metric_octopus_export: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_export_current_rate)' + + # Standing charge in pounds, can be set to a sensor or manually entered (e.g. 0.50 is 50p) + # The default below will pick up the standing charge from the Octopus Plugin + # The standing charge only impacts the cost graphs and doesn't change the way Predbat plans + # If you don't want to show the standing charge then just delete this line or set to zero + metric_standing_charge: 're:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_standing_charge)' + + # Or set your actual rates across time for import and export + # If start/end is missing it's assumed to be a fixed rate + # Gaps are filled with zero rate + #rates_import: + # - start: "00:30:00" + # end: "04:30:00" + # rate: 7.5 + # - start: "04:30:00" + # end: "00:30:00" + # rate: 40.0 + # + rates_export: + - rate: 0 + + # Can be used instead of the plugin to get import rates directly online + # Overrides metric_octopus_import and rates_import + # See the 'energy rates' part of the documentation for instructions on how to find the correct URL for your tariff and DNO region + # + # rates_import_octopus_url : "https://api.octopus.energy/v1/products/FLUX-IMPORT-23-02-14/electricity-tariffs/E-1R-FLUX-IMPORT-23-02-14-A/standard-unit-rates" + # rates_import_octopus_url : "https://api.octopus.energy/v1/products/AGILE-24-10-01/electricity-tariffs/E-1R-AGILE-24-10-01-A/standard-unit-rates" + + # Overrides metric_octopus_export and rates_export + # rates_export_octopus_url: "https://api.octopus.energy/v1/products/FLUX-EXPORT-23-02-14/electricity-tariffs/E-1R-FLUX-EXPORT-23-02-14-A/standard-unit-rates" + # rates_export_octopus_url: "https://api.octopus.energy/v1/products/AGILE-OUTGOING-19-05-13/electricity-tariffs/E-1R-AGILE-OUTGOING-19-05-13-A/standard-unit-rates/" + + # Import rates can be overridden with rate_import_override + # Export rates can be overridden with rate_export_override + # Use the same format as above, but a date can be included if it just applies for a set day (e.g. Octopus power ups) + # This will override even the Octopus plugin rates if enabled + # + #rates_import_override: + # - date: '2023-09-10' + # start: '14:00:00' + # end: '14:30:00' + # rate: 5 + + # Days previous sets how many days of load history Predbat searches when forecasting your future house load. + # By default this uses a weighted-bucket forecast that automatically accounts for day-of-week, holiday mode + # and recency (days_previous_auto) - see the documentation for other options, such as picking specific + # days/weights instead, or using Load ML. + days_previous: + - 7 + + # Number of hours forward to forecast, best left as-is unless you have specific reason + forecast_hours: 48 + + # Specify the devices that notifies are sent to, the default is 'notify' which goes to all + #notify_devices: + # - mobile_app_treforsiphone12_2 + + # Battery scaling makes the battery smaller (e.g. 0.9) or bigger than its reported + # If you have an 80% DoD battery that falsely reports it's kwh then set it to 0.8 to report the real figures + battery_scaling: 1.0 + + # Can be used to scale import and export data, used for workarounds + import_export_scaling: 1.0 + + # Export triggers: + # For each trigger give a name, the minutes of export needed and the energy required in that time + # Multiple triggers can be set at once so in total you could use too much energy if all run + # Creates an entity called 'binary_sensor.predbat_export_trigger_' which will be turned On when the condition is valid + # connect this to your automation to start whatever you want to trigger + export_triggers: + - name: 'large' + minutes: 60 + energy: 1.0 + - name: 'small' + minutes: 15 + energy: 0.25 + + # If you have a sensor that gives the energy consumed by your solar diverter then add it here + # this will make the predictions more accurate. It should be an incrementing sensor, it can reset at midnight or not + # It's assumed to be in Kwh but scaling can be applied if need be + #iboost_energy_today: 'sensor.tasmota_energy_today' + #iboost_energy_scaling: 1.0 + + # Nordpool market energy rates + #futurerate_url: 'https://dataportal-api.nordpoolgroup.com/api/DayAheadPrices?date=DATE&market=N2EX_DayAhead&deliveryArea=UK¤cy=GBP' + #futurerate_adjust_import: False + #futurerate_adjust_export: True + #futurerate_peak_start: "16:00:00" + #futurerate_peak_end: "19:00:00" + #futurerate_peak_premium_import: 14 + #futurerate_peak_premium_export: 6.5 diff --git a/templates/sofar_inverter.yaml b/templates/sofar_inverter.yaml index 39545b523..92bec1f6f 100644 --- a/templates/sofar_inverter.yaml +++ b/templates/sofar_inverter.yaml @@ -1,374 +1,374 @@ -#Sofar ME3000SP Sofar2mqtt sensors -#Updated to now include the new MQTT sensors required for 2022.12 release of Home Assistant onwards -sensor: - - platform: integration - name: Energy_from_battery - source: sensor.sofar_inverter_battery_discharge - unit_prefix: k - unit_time: h - method: left - - - platform: integration - name: Energy_to_battery - source: sensor.sofar_inverter_battery_charge - unit_prefix: k - unit_time: h - method: left - -input_number: - sofar_battery_size: - name: Battery Size - unit_of_measurement: "kWh" - initial: 4.800 - min: 0 - max: 48.000 - step: 1.200 - - sofar_battery_max_charge: - name: Battery Max Charge - unit_of_measurement: "kWh" - initial: 4.800 - min: 0 - max: 48.000 - step: 1.20 - - sofar_battery_min_charge: - name: Battery Min Charge - unit_of_measurement: "kWh" - initial: 9.60 - min: 0 - max: 48.000 - step: 0.120 - -template: - sensor: - - name: "Sofar Battery Energy" - unique_id: 875bdcf3-c93c-409b-8324-f00aec7878f5 - unit_of_measurement: "kWh" - device_class: energy - state: >- - {% set e = (states('input_number.sofar_battery_size') | float ) %} - {% set p = (states('sensor.sofar_inverter_battery_SoC') | float ) %} - {{ e * p / (100) | float(0) }} - availability: > - {{ states('sensor.sofar_inverter_battery_SoC') | is_number }} - - -mqtt: - sensor: - - name: "sofar_inverter_running_state" - state_topic: "Sofar2mqtt/state" - value_template: >- - {% if value_json.running_state == 0 %} - {{ "0-Standby" }} - {% elif value_json.running_state == 1 %} - {{ "1-Check charge" }} - {% elif value_json.running_state == 2 %} - {{ "2-Charging" }} - {% elif value_json.running_state == 3 %} - {{ "3-Check discharge" }} - {% elif value_json.running_state == 4 %} - {{ "4-Discharging" }} - {% elif value_json.running_state == 5 %} - {{ "5-EPSState" }} - {% elif value_json.running_state == 6 %} - {{ "6-Fault" }} - {% elif value_json.running_state == 7 %} - {{ "7-Permanent Fault" }} - {% else %} - {{ "Undetermined" }} - {% endif %} - - - name: "sofar_grid_voltage" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "V" - device_class: voltage - state_class: measurement - value_template: "{{ value_json.grid_voltage / 10}}" - - - name: "sofar_grid_current" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "A" - device_class: current - state_class: measurement - value_template: "{{ value_json.grid_current /100 }}" - - - name: "sofar_grid_frequency" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "Hz" - device_class: frequency - state_class: measurement - value_template: "{{ value_json.grid_freq /100 }}" - - - name: "sofar_mqtt_runtime" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "s" - value_template: "{{ value_json.runtime /1000 }}" - - - name: "sofar_grid_power" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: >- - {% if value_json.grid_power > (65535 / 2) %} - {{ (65535 - value_json.grid_power) * 10 }} - {% else %} - {{ -(value_json.grid_power) * 10 }} - {% endif %} - - - name: "sofar_inverter_battery_power" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: > - {% if value_json.battery_power > (65535 / 2) %} - {{ -(65535 - value_json.battery_power) * 10 }} - {% else %} - {{ (value_json.battery_power) * 10 }} - {% endif %} - - - name: "sofar_inverter_system_power" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: > - {% if value_json.systemIO_power > (65535 / 2) %} - {{ (65535 - value_json.systemIO_power) * 10 }} - {% else %} - {{ -(value_json.systemIO_power) * 10 }} - {% endif %} - - - name: "sofar_inverter_battery_discharge" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: > - {% if (value_json.battery_power > 32767) %} - {{ (65535 - value_json.battery_power) * 10 }} - {% else %} - {{ 0 }} - {% endif %} - - - name: "sofar_inverter_battery_charge" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: > - {% if (value_json.battery_power < 32767) %} - {{ (value_json.battery_power) * 10 }} - {% else %} - {{ 0 }} - {% endif %} - - - name: "sofar_inverter_battery_voltage" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "V" - device_class: voltage - state_class: measurement - value_template: "{{ value_json.battery_voltage / 100}}" - - - name: "sofar_inverter_battery_current" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "A" - device_class: current - state_class: measurement - value_template: "{{ value_json.battery_current /100}}" - - - name: "sofar_inverter_battery_SoC" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "%" - device_class: battery - state_class: measurement - value_template: "{{ value_json.batterySOC }}" - - - name: "sofar_inverter_battery_temp" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "°C" - device_class: temperature - state_class: measurement - value_template: "{{ value_json.battery_temp }}" - - - name: "sofar_inverter_battery_cycles" - state_topic: "Sofar2mqtt/state" - state_class: total_increasing - value_template: "{{ value_json.battery_cycles }}" - - - name: "sofar_house_consumption_power" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: "{{ value_json.consumption *10 }}" - - - name: "sofar_solar_power" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "W" - device_class: power - state_class: measurement - value_template: "{{ value_json.solarPV *10 }}" - - - name: "sofar_solar_current" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "A" - device_class: current - state_class: measurement - value_template: "{{ value_json.solarPVAmps }}" - - - name: "sofar_energy_today_exported" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "kWh" - device_class: energy - state_class: total_increasing - value_template: "{{ value_json.today_exported /100 }}" - - - name: "sofar_energy_today_purchase" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "kWh" - device_class: energy - state_class: total_increasing - value_template: "{{ value_json.today_purchase /100 }}" - - - name: "sofar_energy_today_consumption" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "kWh" - device_class: energy - state_class: total_increasing - value_template: "{{ value_json.today_consumption /100 }}" - - - name: "sofar_energy_today_generation" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "kWh" - device_class: energy - state_class: total_increasing - value_template: "{{ value_json.today_generation /100 }}" - - - name: "sofar_inverter_heatsink_temp" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "°C" - device_class: temperature - state_class: measurement - value_template: "{{ value_json.inverter_HStemp }}" - - - name: "sofar_inverter_inner_temp" - state_topic: "Sofar2mqtt/state" - unit_of_measurement: "°C" - device_class: temperature - state_class: measurement - value_template: "{{ value_json.inverter_temp }}" - - switch: - - name: "SoFar Standby Mode" - command_topic: "Sofar2mqtt/set/standby" - state_topic: "Sofar2mqtt/set/standby" - payload_on: "true" - retain: true - - - name: "SoFar Auto Saver Mode" - command_topic: "Sofar2mqtt/set/auto" - state_topic: "Sofar2mqtt/set/auto" - qos: 1 - payload_on: "true" - payload_off: "battery_save" - retain: true - - - name: "SoFar Auto Mode" - command_topic: "Sofar2mqtt/set/auto" - state_topic: "Sofar2mqtt/set/auto" - qos: 1 - payload_on: "true" - retain: true - - - name: "SoFar Battery Saver Mode" - command_topic: "Sofar2mqtt/set/auto" - state_topic: "Sofar2mqtt/set/auto" - qos: 1 - payload_on: "battery_save" - retain: true - - - name: "SoFar Charge Mode 1000" - command_topic: "Sofar2mqtt/set/charge" - state_topic: "Sofar2mqtt/set/charge" - qos: 1 - payload_on: "1000" - retain: true - - - name: "SoFar Charge Mode 1500" - command_topic: "Sofar2mqtt/set/charge" - state_topic: "Sofar2mqtt/set/charge" - qos: 1 - payload_on: "1500" - retain: true - - - name: "SoFar Charge Mode 2000" - command_topic: "Sofar2mqtt/set/charge" - state_topic: "Sofar2mqtt/set/charge" - qos: 1 - payload_on: "2000" - retain: true - - - name: "SoFar Charge Mode 2500" - command_topic: "Sofar2mqtt/set/charge" - state_topic: "Sofar2mqtt/set/charge" - qos: 1 - payload_on: "2500" - retain: true - - - name: "SoFar Charge Mode 3000" - command_topic: "Sofar2mqtt/set/charge" - state_topic: "Sofar2mqtt/set/charge" - qos: 1 - payload_on: "3000" - retain: true - - - name: "SoFar DisCharge Mode 1000" - command_topic: "Sofar2mqtt/set/discharge" - state_topic: "Sofar2mqtt/set/discharge" - qos: 1 - payload_on: "1000" - retain: true - - - name: "SoFar DisCharge Mode 1500" - command_topic: "Sofar2mqtt/set/discharge" - state_topic: "Sofar2mqtt/set/discharge" - qos: 1 - payload_on: "1500" - retain: true - - - name: "SoFar DisCharge Mode 2000" - command_topic: "Sofar2mqtt/set/discharge" - state_topic: "Sofar2mqtt/set/discharge" - qos: 1 - payload_on: "2000" - retain: true - - - name: "SoFar DisCharge Mode 2500" - command_topic: "Sofar2mqtt/set/discharge" - state_topic: "Sofar2mqtt/set/discharge" - qos: 1 - payload_on: "2500" - retain: true - - - name: "SoFar DisCharge Mode 3000" - command_topic: "Sofar2mqtt/set/discharge" - state_topic: "Sofar2mqtt/set/discharge" - qos: 1 - payload_on: "3000" - retain: true - - button: - - name: "Sofar Set - Standby" - command_topic: "sofar/set/standby" - - - name: "Sofar Set - Auto" - command_topic: "sofar/set/auto" - - - name: "Sofar Set - Charge" - command_topic: "sofar/set/charge" - - - name: "Sofar Set - Discharge" - command_topic: "sofar/set/discharge" +#Sofar ME3000SP Sofar2mqtt sensors +#Updated to now include the new MQTT sensors required for 2022.12 release of Home Assistant onwards +sensor: + - platform: integration + name: Energy_from_battery + source: sensor.sofar_inverter_battery_discharge + unit_prefix: k + unit_time: h + method: left + + - platform: integration + name: Energy_to_battery + source: sensor.sofar_inverter_battery_charge + unit_prefix: k + unit_time: h + method: left + +input_number: + sofar_battery_size: + name: Battery Size + unit_of_measurement: "kWh" + initial: 4.800 + min: 0 + max: 48.000 + step: 1.200 + + sofar_battery_max_charge: + name: Battery Max Charge + unit_of_measurement: "kWh" + initial: 4.800 + min: 0 + max: 48.000 + step: 1.20 + + sofar_battery_min_charge: + name: Battery Min Charge + unit_of_measurement: "kWh" + initial: 9.60 + min: 0 + max: 48.000 + step: 0.120 + +template: + sensor: + - name: "Sofar Battery Energy" + unique_id: 875bdcf3-c93c-409b-8324-f00aec7878f5 + unit_of_measurement: "kWh" + device_class: energy + state: >- + {% set e = (states('input_number.sofar_battery_size') | float ) %} + {% set p = (states('sensor.sofar_inverter_battery_SoC') | float ) %} + {{ e * p / (100) | float(0) }} + availability: > + {{ states('sensor.sofar_inverter_battery_SoC') | is_number }} + + +mqtt: + sensor: + - name: "sofar_inverter_running_state" + state_topic: "Sofar2mqtt/state" + value_template: >- + {% if value_json.running_state == 0 %} + {{ "0-Standby" }} + {% elif value_json.running_state == 1 %} + {{ "1-Check charge" }} + {% elif value_json.running_state == 2 %} + {{ "2-Charging" }} + {% elif value_json.running_state == 3 %} + {{ "3-Check discharge" }} + {% elif value_json.running_state == 4 %} + {{ "4-Discharging" }} + {% elif value_json.running_state == 5 %} + {{ "5-EPSState" }} + {% elif value_json.running_state == 6 %} + {{ "6-Fault" }} + {% elif value_json.running_state == 7 %} + {{ "7-Permanent Fault" }} + {% else %} + {{ "Undetermined" }} + {% endif %} + + - name: "sofar_grid_voltage" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "V" + device_class: voltage + state_class: measurement + value_template: "{{ value_json.grid_voltage / 10}}" + + - name: "sofar_grid_current" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "A" + device_class: current + state_class: measurement + value_template: "{{ value_json.grid_current /100 }}" + + - name: "sofar_grid_frequency" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "Hz" + device_class: frequency + state_class: measurement + value_template: "{{ value_json.grid_freq /100 }}" + + - name: "sofar_mqtt_runtime" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "s" + value_template: "{{ value_json.runtime /1000 }}" + + - name: "sofar_grid_power" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: >- + {% if value_json.grid_power > (65535 / 2) %} + {{ (65535 - value_json.grid_power) * 10 }} + {% else %} + {{ -(value_json.grid_power) * 10 }} + {% endif %} + + - name: "sofar_inverter_battery_power" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: > + {% if value_json.battery_power > (65535 / 2) %} + {{ -(65535 - value_json.battery_power) * 10 }} + {% else %} + {{ (value_json.battery_power) * 10 }} + {% endif %} + + - name: "sofar_inverter_system_power" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: > + {% if value_json.systemIO_power > (65535 / 2) %} + {{ (65535 - value_json.systemIO_power) * 10 }} + {% else %} + {{ -(value_json.systemIO_power) * 10 }} + {% endif %} + + - name: "sofar_inverter_battery_discharge" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: > + {% if (value_json.battery_power > 32767) %} + {{ (65535 - value_json.battery_power) * 10 }} + {% else %} + {{ 0 }} + {% endif %} + + - name: "sofar_inverter_battery_charge" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: > + {% if (value_json.battery_power < 32767) %} + {{ (value_json.battery_power) * 10 }} + {% else %} + {{ 0 }} + {% endif %} + + - name: "sofar_inverter_battery_voltage" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "V" + device_class: voltage + state_class: measurement + value_template: "{{ value_json.battery_voltage / 100}}" + + - name: "sofar_inverter_battery_current" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "A" + device_class: current + state_class: measurement + value_template: "{{ value_json.battery_current /100}}" + + - name: "sofar_inverter_battery_SoC" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "%" + device_class: battery + state_class: measurement + value_template: "{{ value_json.batterySOC }}" + + - name: "sofar_inverter_battery_temp" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + value_template: "{{ value_json.battery_temp }}" + + - name: "sofar_inverter_battery_cycles" + state_topic: "Sofar2mqtt/state" + state_class: total_increasing + value_template: "{{ value_json.battery_cycles }}" + + - name: "sofar_house_consumption_power" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: "{{ value_json.consumption *10 }}" + + - name: "sofar_solar_power" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "W" + device_class: power + state_class: measurement + value_template: "{{ value_json.solarPV *10 }}" + + - name: "sofar_solar_current" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "A" + device_class: current + state_class: measurement + value_template: "{{ value_json.solarPVAmps }}" + + - name: "sofar_energy_today_exported" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing + value_template: "{{ value_json.today_exported /100 }}" + + - name: "sofar_energy_today_purchase" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing + value_template: "{{ value_json.today_purchase /100 }}" + + - name: "sofar_energy_today_consumption" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing + value_template: "{{ value_json.today_consumption /100 }}" + + - name: "sofar_energy_today_generation" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing + value_template: "{{ value_json.today_generation /100 }}" + + - name: "sofar_inverter_heatsink_temp" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + value_template: "{{ value_json.inverter_HStemp }}" + + - name: "sofar_inverter_inner_temp" + state_topic: "Sofar2mqtt/state" + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + value_template: "{{ value_json.inverter_temp }}" + + switch: + - name: "SoFar Standby Mode" + command_topic: "Sofar2mqtt/set/standby" + state_topic: "Sofar2mqtt/set/standby" + payload_on: "true" + retain: true + + - name: "SoFar Auto Saver Mode" + command_topic: "Sofar2mqtt/set/auto" + state_topic: "Sofar2mqtt/set/auto" + qos: 1 + payload_on: "true" + payload_off: "battery_save" + retain: true + + - name: "SoFar Auto Mode" + command_topic: "Sofar2mqtt/set/auto" + state_topic: "Sofar2mqtt/set/auto" + qos: 1 + payload_on: "true" + retain: true + + - name: "SoFar Battery Saver Mode" + command_topic: "Sofar2mqtt/set/auto" + state_topic: "Sofar2mqtt/set/auto" + qos: 1 + payload_on: "battery_save" + retain: true + + - name: "SoFar Charge Mode 1000" + command_topic: "Sofar2mqtt/set/charge" + state_topic: "Sofar2mqtt/set/charge" + qos: 1 + payload_on: "1000" + retain: true + + - name: "SoFar Charge Mode 1500" + command_topic: "Sofar2mqtt/set/charge" + state_topic: "Sofar2mqtt/set/charge" + qos: 1 + payload_on: "1500" + retain: true + + - name: "SoFar Charge Mode 2000" + command_topic: "Sofar2mqtt/set/charge" + state_topic: "Sofar2mqtt/set/charge" + qos: 1 + payload_on: "2000" + retain: true + + - name: "SoFar Charge Mode 2500" + command_topic: "Sofar2mqtt/set/charge" + state_topic: "Sofar2mqtt/set/charge" + qos: 1 + payload_on: "2500" + retain: true + + - name: "SoFar Charge Mode 3000" + command_topic: "Sofar2mqtt/set/charge" + state_topic: "Sofar2mqtt/set/charge" + qos: 1 + payload_on: "3000" + retain: true + + - name: "SoFar DisCharge Mode 1000" + command_topic: "Sofar2mqtt/set/discharge" + state_topic: "Sofar2mqtt/set/discharge" + qos: 1 + payload_on: "1000" + retain: true + + - name: "SoFar DisCharge Mode 1500" + command_topic: "Sofar2mqtt/set/discharge" + state_topic: "Sofar2mqtt/set/discharge" + qos: 1 + payload_on: "1500" + retain: true + + - name: "SoFar DisCharge Mode 2000" + command_topic: "Sofar2mqtt/set/discharge" + state_topic: "Sofar2mqtt/set/discharge" + qos: 1 + payload_on: "2000" + retain: true + + - name: "SoFar DisCharge Mode 2500" + command_topic: "Sofar2mqtt/set/discharge" + state_topic: "Sofar2mqtt/set/discharge" + qos: 1 + payload_on: "2500" + retain: true + + - name: "SoFar DisCharge Mode 3000" + command_topic: "Sofar2mqtt/set/discharge" + state_topic: "Sofar2mqtt/set/discharge" + qos: 1 + payload_on: "3000" + retain: true + + button: + - name: "Sofar Set - Standby" + command_topic: "sofar/set/standby" + + - name: "Sofar Set - Auto" + command_topic: "sofar/set/auto" + + - name: "Sofar Set - Charge" + command_topic: "sofar/set/charge" + + - name: "Sofar Set - Discharge" + command_topic: "sofar/set/discharge"