Egyras / HeishaMon

Panasonic Aquarea air-water H, J, K and L series protocol decrypt
241 stars 122 forks source link

Enhancement request - MQTT Discovery #267

Closed hendrer closed 1 year ago

hendrer commented 2 years ago

Would it be possible to implement MQTT Discovery for Home Assistant instead of relying on the YAML here? I've seen this done with Solar Assistant and it's very clean.

Let me know if you need more details and if you're interested to implement.

Cheers

hendrer commented 2 years ago

Example of MQTT Discovery implementation for Home Assistant. https://solar-assistant.io/help/home-assistant/setup

hendrer commented 2 years ago

HA documentation https://www.home-assistant.io/docs/mqtt/discovery/

IgorYbema commented 2 years ago

Maybe for v4.0 release but be my guest to try to implement it. It has been asked before but no one seems to really need it.

It also breaks current mqtt logic (need to build a new mqtt tree) and that will then break other implementations.

PGnl commented 2 years ago

Need it, is indeed true. I however would like it. Would save me from having to set up heisha on HA for other people as it would automatically be recognised.

geduxas commented 2 years ago

Truly nothing special it will not bring.. almost everything is in yaml file, and automation just skips yaml configuration..

I think it's best to build HA addon to integrate heishamon... and there could me more possibilities.

kamaradclimber commented 2 years ago

I would be interested by the auto discovery as well. Of course we can do without it, it's mostly for convenience.

kamaradclimber commented 2 years ago

In the meantime, I've started a prototype of an integration on https://github.com/kamaradclimber/heishamon-homeassistant. It's already usable and reproduces all sensors from https://github.com/Egyras/HeishaMon/blob/master/Integrations/Home%20Assistant/heishamon.yaml (except inputs and automations).

Alwik commented 2 years ago

Great work @kamaradclimber ! I have tested already, and it works perfectly, thanks a lot!

geduxas commented 2 years ago

@kamaradclimber could you make it HACS accessable?

Alwik commented 2 years ago

@geduxas HACS -> Integrations -> 3-dot menu in top right -> Custom repositories -> Repository = https://github.com/kamaradclimber/heishamon-homeassistant Category = Integration After a reboot it should detect a new integration

geduxas commented 2 years ago

@geduxas HACS -> Integrations -> 3-dot menu in top right -> Custom repositories -> Repository = https://github.com/kamaradclimber/heishamon-homeassistant Category = Integration After a reboot it should detect a new integration

Sorry i was too quick :D i found it's already HACS accessable. I thought about this kind of integration but didn't have chanse to start! Nice work. Do you think to make climate component for that? Maybe it's on the way too?

kamaradclimber commented 2 years ago

Thanks for the feedback @geduxas :) I hope it will be useful. I have not thought of doing a climate component, I need to have a look at those to see if it would fit since heatpumps are usually handling temperature by themselves. Let me toy a bit with it!

Regarding integration in hacs, right now it is a custom repository. I would like to make it a default repository but given number of pending PR on the hacs repository, it might take a while.

If you have suggestions/bugs, feel free to open issues on the integration repository.

geduxas commented 2 years ago

Thanks for the feedback @geduxas :) I hope it will be useful. I have not thought of doing a climate component, I need to have a look at those to see if it would fit since heatpumps are usually handling temperature by themselves. Let me toy a bit with it!

Regarding integration in hacs, right now it is a custom repository. I would like to make it a default repository but given number of pending PR on the hacs repository, it might take a while.

If you have suggestions/bugs, feel free to open issues on the integration repository.

I am talkong about mqtt.climate component.. it will be desplayed in HA in climate card.. so it will be easer to adjust setpoint temperature.. i have done some testings.. but with integration it could be fulfilled. :) Becouse it should be case sensitive.. one have heatshit curved settings... Another will be on directe temperature settings.. also 1/2 zones..

geduxas commented 2 years ago

here is mine: image

PGnl commented 2 years ago

@kamaradclimber I just tried your addin on a clean proxmox HA copy. Works like a charm indeed. agree with geduxas. Climate mqtt component works like a charm an makes it much nicer. Also wife likes it much more ;) Here also as a dual zone but without DHW.

Thanks for the hard work and making it available. Let me know if I can help with testing.

kamaradclimber commented 2 years ago

I've added a climate entity for the water heater and opened https://github.com/kamaradclimber/heishamon-homeassistant/issues/25 about creating climate component for zone1 & zone2.

I would suggest to continue discussion there to avoid overwhelming this issue which is unrelated.

hendrer commented 2 years ago

I spent some time implementing the MQTT native integrations that might help you all. See attached. It has some personal sensors in there but the top half is relevant

On Sun, 23 Oct 2022, 17:14 Grégoire Seux, @.***> wrote:

I've added a climate entity for the water heater and opened kamaradclimber/heishamon-homeassistant#25 https://github.com/kamaradclimber/heishamon-homeassistant/issues/25 about creating climate component for zone1 & zone2.

I would suggest to continue discussion there to avoid overwhelming this issue which is unrelated.

— Reply to this email directly, view it on GitHub https://github.com/Egyras/HeishaMon/issues/267#issuecomment-1288135332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYO2F67EMYJQWZFW4LPB23WEVI57ANCNFSM6AAAAAAQEKPQ7M . You are receiving this because you authored the thread.Message ID: @.***>

mqtt: climate:

PHP Controller

    - name: PHP Controller
      precision: 1.0
      temperature_unit: C
      min_temp: 0
      max_temp: 40
      current_temperature_topic: "panasonic_heat_pump/main/Room_Thermostat_Temp"
      #power_command_topic: "panasonic_heat_pump/commands/SetHeatpump"
      #payload_on: 1
      #payload_off: 0
      modes:
        - "off"
        - "heat"
        - "auto"
        - "cool"
      mode_state_topic: "panasonic_heat_pump/main/Operating_Mode_State"
      mode_state_template: >-
        {%- if value in ("0","4") -%}

                heat

        {%- elif value in ("1","5") -%}
           cool

        {%- elif value in ("2","6","7","8") -%}
            auto

        {%- else -%}
            off
        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetOperationMode"
      mode_command_template: >-
        {%- if value == "heat" -%}

            {%- if states('climate.php_dhw_controller')  in ("heat") -%} 
                4
            {%- else -%}
                0
            {%- endif -%}

        {%- elif value == "cool" -%}
             {%- if states('climate.php_dhw_controller')  in ("heat") -%} 
                5
            {%- else -%}
                1
            {%- endif -%}
        {%- elif value == "auto" -%}
             {%- if states('climate.php_dhw_controller')  in ("heat") -%} 
                6
            {%- else -%}
                2
            {%- endif -%}
        {%- else -%}
            3
        {%- endif -%}
      preset_modes:
        - "Heat"
        - "Cool"
        - "Auto(Heat)"
        - "DHW"
        - "Heat+DHW"
        - "Cool+DHW"
        - "Auto(Heat)+DHW"
        - "Auto(Cool)"
        - "Auto(Cool)+DHW"

      preset_mode_state_topic: "panasonic_heat_pump/main/Operating_Mode_State"
      preset_mode_command_topic: "panasonic_heat_pump/commands/SetOperationMode"
      preset_mode_value_template: >-
        {%- if value == "0" -%}
            Heat
        {%- elif value == "1" -%}
            Cool
        {%- elif value == "2" -%}
            Auto(Heat)
        {%- elif value == "3" -%}
            DHW
        {%- elif value == "4" -%}
            Heat+DHW
        {%- elif value == "5" -%}
            Cool+DHW
        {%- elif value == "6" -%}
            Auto(Heat)+DHW
        {%- elif value == "7" -%}
            Auto(Cool)
        {%- elif value == "8" -%}
            Auto(Cool)+DHW
        {%- endif -%}
      preset_mode_command_template: >-
        {%- if value == "Heat" -%}
            0
        {%- elif value == "Cool" -%}
            1
        {%- elif value == "Auto(Heat)" -%}
            2
        {%- elif value == "DHW" -%}
            3
        {%- elif value == "Heat+DHW" -%}
            4
        {%- elif value == "Cool+DHW" -%}
            5
        {%- elif value == "Auto(Heat)+DHW" -%}
            6
        {%- elif value == "Auto(Cool)" -%}
            7
        {%- elif value == "Auto(Cool)+DHW" -%}
            8
        {%- endif -%}
      action_topic: "panasonic_heat_pump/main/Operating_Mode_State"
      action_template: >-
        {%- if states('sensor.php_3_way_valve') in ("Room") 
            and states('binary_sensor.php_on_off') == "on" -%}
          {%- if value == "0" -%}
            heating
          {%- elif value == "1" -%}
            cooling
          {%- elif value == "2" -%}
            heating
          {%- elif value == "3" -%}
            idle
          {%- elif value == "4" -%}
            heating
          {%- elif value == "5" -%}
            cooling
          {%- elif value == "6" -%}
            heating
          {%- elif value == "7" -%}
            cooling
          {%- elif value == "8" -%}
            cooling
          {%- endif -%}
        {%- else -%}
          idle
        {%- endif -%}

    # Zone 1 Heating
    - name: PHP Zone 1 Heating
    #   availability_topic: "panasonic_heat_pump/LWT"
      precision: 1.0
      modes:
        - "off"
        - "heat"
      mode_state_topic: "panasonic_heat_pump/main/Zones_State"
      mode_state_template: >-
        {%- if value in ("0","2") -%}

            {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Heat","Heat+DHW","Auto(Heat)","Auto(Heat)+DHW") -%}  
                heat
            {%- else -%}
                off
            {%- endif -%}

        {%- else -%}
            off
        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetZones"
      mode_command_template: >-
          {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Heat","Heat+DHW","Auto(Heat)","Auto(Heat)+DHW") -%}

                {%- if value == "heat" -%}

                    {%- if states('climate.php_zone_2_heating') in ("heat") -%}

                        2

                    {%- else -%}

                        0

                    {%- endif -%}

                {%- else -%}

                    1

                {%- endif -%}

            {%- endif -%} 
      current_temperature_topic: "panasonic_heat_pump/main/Z1_Water_Temp"
      temperature_command_topic: "panasonic_heat_pump/commands/SetZ1HeatRequestTemperature"
      temperature_state_topic: "panasonic_heat_pump/main/Z1_Heat_Request_Temp"
      temperature_unit: C
      min_temp: 20
      max_temp: 60

    # Zone 2 Heating
    - name: PHP Zone 2 Heating
    #   availability_topic: "panasonic_heat_pump/LWT"
      precision: 1.0
      modes:
        - "off"
        - "heat"
      mode_state_topic: "panasonic_heat_pump/main/Zones_State"
      mode_state_template: >-
        {%- if value in ("1","2") -%}

            {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Heat","Heat+DHW","Auto(Heat)","Auto(Heat)+DHW") -%} 
                heat
            {%- else -%}
                off
            {%- endif -%}

        {%- else -%}
            off
        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetZones"
      mode_command_template: >-
        {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Heat","Heat+DHW","Auto(Heat)","Auto(Heat)+DHW") -%}

            {%- if value == "heat" -%}

                {%- if states('climate.php_zone_1_heating') in ("heat") -%}

                    2

                {%- else -%}

                    1

                {%- endif -%}

            {%- else -%}

                0

            {%- endif -%}

        {%- endif -%}  
      current_temperature_topic: "panasonic_heat_pump/main/Z2_Water_Temp"
      temperature_command_topic: "panasonic_heat_pump/commands/SetZ2HeatRequestTemperature"
      temperature_state_topic: "panasonic_heat_pump/main/Z2_Heat_Request_Temp"
      temperature_unit: C
      min_temp: 20
      max_temp: 60

    # DHW Controller
    - name: PHP DHW Controller
    #   availability_topic: "panasonic_heat_pump/LWT"
      precision: 1.0
      modes:
        - "off"
        - "heat"
      mode_state_topic: "panasonic_heat_pump/main/Operating_Mode_State"
      mode_state_template: >-
        {%- if value in ("3","4","5","6","8") -%}

                heat

        {%- else -%}
            off
        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetOperationMode"
      mode_command_template: >-
        {%- if states('climate.php_controller')  in ("auto") -%}

            {%- if value == "heat" -%}
                6
            {%- else -%}
                2
            {%- endif -%}

        {%- elif states('climate.php_controller')  in ("heat") -%}

            {%- if value == "heat" -%}
                4
            {%- else -%}
                0
            {%- endif -%}

        {%- elif states('climate.php_controller')  in ("cool") -%}

            {%- if value == "heat" -%}
                5
            {%- else -%}
                1
            {%- endif -%}

        {%- endif -%}
      current_temperature_topic: "panasonic_heat_pump/main/DHW_Temp"
      temperature_command_topic: "panasonic_heat_pump/commands/SetDHWTemp"
      temperature_state_topic: "panasonic_heat_pump/main/DHW_Target_Temp"
      temperature_unit: C
      min_temp: 40
      max_temp: 75
      preset_modes:
        - "Force-Active"
        - "Force-Disabled"
      preset_mode_state_topic: "panasonic_heat_pump/main/Force_DHW_State"
      preset_mode_command_topic: "panasonic_heat_pump/commands/SetForceDHW"
      preset_mode_value_template: >-
        {%- if value == "0" -%}
            Force-Disabled
        {%- else -%}
            Force-Active
        {%- endif -%}
      preset_mode_command_template: >-
        {%- if value == "Force-Disabled" -%}
            0
        {%- elif value == "Force-Active" -%}
            1
        {%- endif -%}
      action_topic: "panasonic_heat_pump/main/Operating_Mode_State"
      action_template: >-
        {%- if states('sensor.php_3_way_valve')  in ("Tank") 
            and states('binary_sensor.php_on_off') == "on" -%}
          {%- if value == "0" -%}
            idle
          {%- elif value == "1" -%}
            idle
          {%- elif value == "2" -%}
            idle
          {%- elif value == "3" -%}
            heating
          {%- elif value == "4" -%}
            heating
          {%- elif value == "5" -%}
            heating
          {%- elif value == "6" -%}
            heating
          {%- elif value == "7" -%}
            idle
          {%- elif value == "8" -%}
            heating
          {%- endif -%}
        {%- else -%}
          idle
        {%- endif -%}

    # Zone 1 Cooling
    - name: PHP Zone 1 Cooling
    #   availability_topic: "panasonic_heat_pump/LWT"
      precision: 1.0
      modes:
        - "off"
        - "cool"
      mode_state_topic: "panasonic_heat_pump/main/Zones_State"
      mode_state_template: >-
        {%- if value in ("0","2") -%}

            {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Cool","Cool+DHW","Auto(Cool)","Auto(Cool)+DHW") -%}  
                cool
            {%- else -%}
                off
            {%- endif -%}

        {%- else -%}
            off
        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetZones"
      mode_command_template: >-
          {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Cool","Cool+DHW","Auto(Cool)","Auto(Cool)+DHW") -%}

                {%- if value == "cool" -%}

                    {%- if states('climate.php_zone_2_cooling') in ("cool") -%}

                        2

                    {%- else -%}

                        0

                    {%- endif -%}

                {%- else -%}

                    1

                {%- endif -%}

            {%- endif -%} 
      current_temperature_topic: "panasonic_heat_pump/main/Z1_Water_Temp"
      temperature_command_topic: "panasonic_heat_pump/commands/SetZ1CoolRequestTemperature"
      temperature_state_topic: "panasonic_heat_pump/main/Z1_Cool_Request_Temp"
      temperature_unit: C
      min_temp: 5
      max_temp: 20

    # Zone 2 Cooling
    - name: PHP Zone 2 Cooling
    #   availability_topic: "panasonic_heat_pump/LWT"
      precision: 1.0
      modes:
        - "off"
        - "cool"
      mode_state_topic: "panasonic_heat_pump/main/Zones_State"
      mode_state_template: >-
        {%- if value in ("1","2") -%}

            {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Cool","Cool+DHW","Auto(Cool)","Auto(Cool)+DHW") -%} 
                cool
            {%- else -%}
                off
            {%- endif -%}

        {%- else -%}
            off
        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetZones"
      mode_command_template: >-
        {%- if state_attr('climate.php_controller', 'preset_mode')  in ("Cool","Cool+DHW","Auto(Cool)","Auto(Cool)+DHW") -%}

            {%- if value == "cool" -%}

                {%- if states('climate.php_zone_1_cooling') in ("cool") -%}

                    2

                {%- else -%}

                    1

                {%- endif -%}

            {%- else -%}

                0

            {%- endif -%}

        {%- endif -%}  
      current_temperature_topic: "panasonic_heat_pump/main/Z2_Water_Temp"
      temperature_command_topic: "panasonic_heat_pump/commands/SetZ2CoolRequestTemperature"
      temperature_state_topic: "panasonic_heat_pump/main/Z2_Cool_Request_Temp"
      temperature_unit: C
      min_temp: 5
      max_temp: 20

    # PHP Sterilization
    - name: PHP Sterilization
      precision: 1.0
      temperature_unit: C
      min_temp: 50
      max_temp: 70
      current_temperature_topic: "panasonic_heat_pump/main/DHW_Temp"
      temperature_state_topic: "panasonic_heat_pump/main/Sterilization_Temp"
      modes:
        - "off"
        - "heat"
      mode_state_topic: "panasonic_heat_pump/main/Sterilization_State"
      mode_state_template: >-
        {%- if value in ("0") -%}

                off

        {%- elif value in ("1") -%}
           heat

        {%- endif -%}
      mode_command_topic: "panasonic_heat_pump/commands/SetForceSterilization"
      mode_command_template: >-
        {%- if value == "heat" -%}

            1

        {%- else -%}
            0
        {%- endif -%}

switch:
    #PHP Master On/off
    - name: PHP Power Switch
      command_topic: "panasonic_heat_pump/commands/SetHeatpump"
      payload_off: 0
      payload_on: 1
      state_topic: "panasonic_heat_pump/main/Heatpump_State"
      state_on: 1
      state_off: 0
      #optimistic: true

    #PHP Holiday Mode On/off
    - name: PHP Holiday Mode
      command_topic: "panasonic_heat_pump/commands/SetHolidayMode"
      payload_off: 0
      payload_on: 1
      state_topic: "panasonic_heat_pump/main/Holiday_Mode_State"
      state_on: 1
      state_off: 0
    #   #optimistic: true
    #   value_template: >-
    #       {%- if value in ("0") -%}

    #                 True

    #         {%- elif value in ("1","2") -%}
    #           False

    #         {%- endif -%}

    #PHP Defrost On/Off
    - name: PHP Force Defrost
      command_topic: "panasonic_heat_pump/commands/SetForceDefrost"
      payload_off: 0
      payload_on: 1
      state_topic: "panasonic_heat_pump/main/Defrosting_State"
      state_on: 1
      state_off: 0

    #PHP Main Schedule On/Off
    - name: PHP Main Schedule Switch
      command_topic: "panasonic_heat_pump/commands/SetMainSchedule"
      payload_off: 0
      payload_on: 1
      state_topic: "panasonic_heat_pump/main/Main_Schedule_State"
      state_on: 1
      state_off: 0  

number:
    #PHP Quiet Mode
    - name: PHP Quiet Mode
      command_topic: "panasonic_heat_pump/commands/SetQuietMode"
      min: 0
      max: 3
      mode: slider
      state_topic: "panasonic_heat_pump/main/Quiet_Mode_Level"

    #PHP Powerful Mode
    - name: PHP Powerful Mode
      command_topic: "panasonic_heat_pump/commands/SetPowerfulMode"
      state_topic: "panasonic_heat_pump/main/Powerful_Mode_Time"
      min: 0
      max: 90
      mode: slider
      step: 30
      command_template: >-
        {%- if value == "0" -%}
            0
        {%- elif value == "30" -%}
            1
        {%- elif value == "60" -%}
            2
        {%- elif value == "90" -%}
            3
        {%- endif -%}
      value_template: >-
        {%- if value == "0" -%}
            0
        {%- elif value == "1" -%}
            30
        {%- elif value == "2" -%}
            60
        {%- elif value == "3" -%}
            90
        {%- endif -%}
      unit_of_measurement: minutes

    #PHP Max Pump Duty
    - name: PHP Max Pump Duty
      command_topic: "panasonic_heat_pump/commands/SetMaxPumpDuty"
      state_topic: "panasonic_heat_pump/main/Max_Pump_Duty"
      min: 64
      max: 254
      #mode: slider
      step: 1

    #PHP DHW Delta
    - name: PHP DHW Delta
      command_topic: "panasonic_heat_pump/commands/SetDHWHeatDelta"
      state_topic: "panasonic_heat_pump/main/DHW_Heat_Delta"
      min: -15
      max: -1
      #mode: slider
      step: 1

sensor:
    #PHP DHW Sterilization Time
    - name: PHP DWH Sterilization Time
      force_update: true
      #min: 1
      #max: 60
      state_topic: "panasonic_heat_pump/main/Sterilization_Max_Time"
      unit_of_measurement: minutes

    #TOP1 - Pumpflow
    - name: PHP Pump Flow
      state_topic: "panasonic_heat_pump/main/Pump_Flow"
      unit_of_measurement: 'L/min' 

    #TOP5 - Water inlet temp
    - name: PHP Inlet Temperature
      state_topic: "panasonic_heat_pump/main/Main_Inlet_Temp"
      unit_of_measurement: '°C'

    #TOP6 - Water outlet temp
    - name: PHP Outlet Temperature
      state_topic: "panasonic_heat_pump/main/Main_Outlet_Temp"
      unit_of_measurement: '°C'

    #TOP7 - Water outlet target temp
    - name: PHP Outlet Target Temperature
      state_topic: "panasonic_heat_pump/main/Main_Target_Temp"
      unit_of_measurement: '°C'

    #TOP8 - Compressor frequency
    - name: PHP Compressor Frequency
      state_topic: "panasonic_heat_pump/main/Compressor_Freq"
      unit_of_measurement: 'Hz'  

    #TOP11 - Compressor Operating Time
    - name: PHP Compressor Operating Hours
      state_topic: "panasonic_heat_pump/main/Operations_Hours"
      unit_of_measurement: 'Hours'
      state_class: total

    #TOP12 - Compressor On/Off cycle number
    - name: PHP Compressor Start/Stop Counter
      state_topic: "panasonic_heat_pump/main/Operations_Counter"
      state_class: total

    #TOP14 - Outdoor unit ambient temperature
    - name: PHP Outdoor Ambient
      state_topic: "panasonic_heat_pump/main/Outside_Temp"
      unit_of_measurement: '°C'
      state_class: 'measurement'

    #TOP15 - Heating power produced
    - name: PHP Power Produced
      state_topic: "panasonic_heat_pump/main/Heat_Energy_Production"
      unit_of_measurement: 'W'
      device_class: 'power'
      state_class: 'measurement'
      force_update: true

    #TOP16 - Heating power consumed
    - name: PHP Power Consumed
      state_topic: "panasonic_heat_pump/main/Heat_Energy_Consumption"
      unit_of_measurement: 'W'
      device_class: 'power'
      state_class: 'measurement'
      force_update: true

    #TOP20 - 3-way valve state
    - name: PHP 3-way Valve
      state_topic: "panasonic_heat_pump/main/ThreeWay_Valve_State"
      value_template: >-
        {%- if value == "0" -%}
          Room
        {%- elif value == "1" -%}
          Tank
        {%- endif -%}

    #TOP21 - Outside pipe temp
    - name: PHP Outdoor Pipe Temperature
      state_topic: "panasonic_heat_pump/main/Outside_Pipe_Temp"
      unit_of_measurement: '°C'  

    #TOP40 - DHW power produced
    - name: PHP DHW Power Produced
      state_topic: "panasonic_heat_pump/main/DHW_Energy_Production"
      unit_of_measurement: 'W'
      device_class: 'power'
      state_class: 'measurement'
      force_update: true

    #TOP41 - DHW power consumed
    - name: PHP DHW Power Consumed
      state_topic: "panasonic_heat_pump/main/DHW_Energy_Consumption"
      unit_of_measurement: 'W'
      device_class: 'power'
      state_class: 'measurement'
      force_update: true

    #TOP44 - Last active error
    - name: PHP Last Error
      state_topic: "panasonic_heat_pump/main/Error"

    #TOP46 - Buffer tank temp
    - name: PHP Buffer Tank Temperature
      state_topic: "panasonic_heat_pump/main/Buffer_Temp"
      unit_of_measurement: '°C'

    #TOP47 - Solar temp
    - name: PHP Solar Temperature
      state_topic: "panasonic_heat_pump/main/Solar_Temp"
      unit_of_measurement: '°C'  

    #TOP49 - Main HEX Outlet temp
    - name: PHP Main HEX Outlet Temperature
      state_topic: "panasonic_heat_pump/main/Main_Hex_Outlet_Temp"
      unit_of_measurement: '°C'

    #TOP50 - Discharge temp
    - name: PHP Discharge Temperature
      state_topic: "panasonic_heat_pump/main/Discharge_Temp"
      unit_of_measurement: '°C'

    #TOP51 - Inside Pipe temp
    - name: PHP Inside Pipe Temperature
      state_topic: "panasonic_heat_pump/main/Inside_Pipe_Temp"
      unit_of_measurement: '°C'

    #TOP52 - Defrost temp
    - name: PHP Defrost Temperature
      state_topic: "panasonic_heat_pump/main/Defrost_Temp"
      unit_of_measurement: '°C'

    #TOP53 - Eva Outlet temp
    - name: PHP Eva Outlet Temperature
      state_topic: "panasonic_heat_pump/main/Eva_Outlet_Temp"
      unit_of_measurement: '°C'

    #TOP54 - Bypass Outlet temp
    - name: PHP Bypass Outlet Temperature
      state_topic: "panasonic_heat_pump/main/Bypass_Outlet_Temp"
      unit_of_measurement: '°C'

    #TOP55 - lpm temp
    - name: PHP Ipm Temperature
      state_topic: "panasonic_heat_pump/main/Ipm_Temp"
      unit_of_measurement: '°C'

    #TOP58 - Tank electric heater allowed state
    - name: PHP Tank Heater Enabled
      state_topic: "panasonic_heat_pump/main/DHW_Heater_State"
      value_template: >-
        {%- if value == "0" -%}
          Off
        {%- elif value == "1" -%}
          On
        {%- endif -%}

    #TOP59 - Water electric heater allowed state
    - name: PHP Room Heater Enabled
      state_topic: "panasonic_heat_pump/main/Room_Heater_State"
      value_template: >-
        {%- if value == "0" -%}
          Off
        {%- elif value == "1" -%}
          On
        {%- endif -%}

    #TOP60 - Internal heater state
    - name: PHP Internal Heater State
      state_topic: "panasonic_heat_pump/main/Internal_Heater_State"
      value_template: >-
        {%- if value == "0" -%}
          Off
        {%- elif value == "1" -%}
          On
        {%- endif -%}

    #TOP61 - External heater state
    - name: PHP External Heater State
      state_topic: "panasonic_heat_pump/main/External_Heater_State"
      value_template: >-
        {%- if value == "0" -%}
          Off
        {%- elif value == "1" -%}
          On
        {%- endif -%}

    #TOP62 - Fan1 speed
    - name: PHP Fan 1 Speed
      state_topic: "panasonic_heat_pump/main/Fan1_Motor_Speed"
      unit_of_measurement: "R/min"

    #TOP63 - Fan2 speed
    - name: PHP Fan 2 Speed
      state_topic: "panasonic_heat_pump/main/Fan2_Motor_Speed"
      unit_of_measurement: "R/min"

    #TOP64 - High pressure
    - name: PHP High pressure
      state_topic: "panasonic_heat_pump/main/High_Pressure"
      unit_of_measurement: "Kgf/cm2"

    #TOP65 - Pump speed
    - name: PHP Pump Speed
      state_topic: "panasonic_heat_pump/main/Pump_Speed"
      unit_of_measurement: "R/min"

  #TOP66 - Low pressure
    - name: PHP Low pressure
      state_topic: "panasonic_heat_pump/main/Low_Pressure"
      unit_of_measurement: "Kgf/cm2"

    #TOP67 - Compressor Current
    - name: PHP Compressor Current
      state_topic: "panasonic_heat_pump/main/Compressor_Current"
      unit_of_measurement: "A"

sensor:

SENSORS BELOW ARE NOT IN FIRMWARE

Energy use/production