Samsung AC

YAML+jinja config sounds great! I didnā€™t see a YAML in the github repo, hence the suggestion. Indeed the format is largely the same just the place in the json differs. Iā€™ve already turned on debug.
Where can I see this YAML example? Thereā€™s nothing like that in the github repo.

Please take a look at dev branch. The component was rewritten by me :wink:

Silly me! Indeed itā€™s there. Iā€™ll be switching to the dev branch then! Iā€™ll tweak the configuration and submit the yaml when itā€™s working properly.

Do you have any plans to make this official HASS component?

If your device is working with REST API then samsungrac.yaml is for you

Whatā€™s that mean. What do I need to do to make this component official. Keep in mind that it is still in dev mode.

Yes, itā€™s REST, and Iā€™ve managed to start off from samsungrac and get it to set temperature properly. Iā€™ll be testing later powering on/off and switching modes.

The only issue I have is that I canā€™t read the external temperature. Does the new component support adding custom attributes? I tried the following:

current_outside_temperature:
  type: number
  stastus_template: '{{ device_state.Temperatures.2.current | int }}'

but I always get -1000

on the other hand:

current_temperature:
  type: number
  status_template: '{{ device_state.Temperatures.0.current }}'

works properly. The module returns an array with Temperatures and the first one (index 0) is the water temperature, while the third element is the outside unitā€™s temperature.

Regarding the official component - I see itā€™s still under heavy development, but once itā€™s ready do you intend to add it to the main home assistant repository?

@kirichkov To be honest, in this component every attribute is custom and configured in yaml file :wink:
If you add debug: true in configuration section then you can go to dev-state panel and see device_state json. You can copy it and test your template in dev-template section.

One more thing: take a look at state_template in status section. In this place component can modify json returned by device and this modified json will be passed as device_state.

Can you provide json from your device?

And last warning, Iā€™ve pushed last version and there are changes in configuration section. More info in this post:

All the controls are working :partying_face:

Save for getting the outside unitā€™s temperature. I also tried to get the data from the device_state attribute but I think the templating engine interprets it as a string, rather than a json/dict.

Hereā€™s my configuration (excerpt):

device:
  status:
    status_template: '{{ device_state.Devices.1 }}'

  attributes:
    current_outside_temperature:
      type: number
      stastus_template: '{{ device_state.Temperatures.2.current }}'

Hereā€™s the (abbreviated) response to GET /devices:

{
  "Devices": [
    {

    },
    {
      "Mode": {
        "modes": [
          "Opmode_Auto",
          "Dhw_Opmode_Not_Supported",
          "Away_Off"
        ],
        "options": [
          "Volume_100"
        ],
        "supportedModes": [
          "Opmode_Auto",
          "Opmode_Cool",
          "Opmode_Heat",
          "Dhw_Opmode_Not_Supported",
          "Away_On",
          "Away_Off"
        ]
      },
      "Operation": {
        "dhwPower": "Not_Supported",
        "power": "Off"
      },
      "Temperatures": [
        {
          "current": 23.6,
          "desired": -1000,
          "id": "0",
          "increment": 1,
          "maximum": -1000,
          "minimum": -1000,
          "name": "INDOOR",
          "unit": "Celsius"
        },
        {
          "current": -1000,
          "desired": -500,
          "id": "1",
          "increment": 1,
          "maximum": -500,
          "minimum": -500,
          "name": "DHW",
          "unit": "Celsius"
        },
        {
          "current": 27.5,
          "desired": -500,
          "id": "2",
          "increment": 1,
          "maximum": -500,
          "minimum": -500,
          "name": "OUTDOOR",
          "unit": "Celsius"
        }
      ],
      "Wind": {
        "direction": "Off",
        "speedLevel": 48,
        "supportedWindModes": [
          "48",
          "Off"
        ]
      },
      "description": "EHS",
      "id": "032000000",
      "name": "32:00:00",
      "resources": [
        "Operation",
        "Wind",
        "Mode",
        "Temperatures",
        "Information",
        "Configuration",
        "Alarms"
      ],
      "type": "Air_Conditioner",
      "uuid": ""
    },
    {

    }
  ]
}

One more question - Whatā€™s the use of target_temp_high and target_temp_low? I looked at other hass components but there doesnā€™t seem to be a clear answer, what it can be used for.

This template was introduced to increase performance but it is not obligatory.
You can set it as: ā€˜{{ device_state.Devices }}ā€™ and modify all status templates to work with it.
You can also remove this line and then json returned by device will be passed as device_state for template rendering. Other status_templates will require update. Chose whatever you want but every part of device json is accessible in component :wink:

As far as I know some devices try to keep desired temp in range <target_temp_lowā€¦target_temp_high> in some modes (E.g. my ET SPIRIT ZWAVE thermostat in heat_eco mode). Itā€™s device specific and my AC unit has such attributes.

Thatā€™s what I thought, I donā€™t think itā€™s applicable in my case.

The weird part is that the whole ā€œTemperaturesā€ array is available at index 1, so I donā€™t think thatā€™s the issue. Iā€™ll dig into it to resolve it or get template sensor working.

Thanks again! :bowing_man:

Try remove state_template from status section. Replace ā€˜device_state.ā€™ with ā€˜device_state.Devices.0.ā€™ in other status_templates. then add your attribute with ā€˜device_state.Devices.1.REST_OF_TEMPLATEā€™.
Should work.

@kirichkov Last version was broken. Iā€™ve updated to better one :slight_smile: . You can take a look at samsungrac.yaml - Iā€™ve removed status_template from status section and modified rest of templates to make it working. You can do the same and add your temperatue attributes.
If you add option debug: true in dev-panel you should have something like this (device_state attribute):


It is json file taken from device. You can see how your JSON looks and adjust templates for it.

Looks like typo: stastus_template instead of status_template :wink:

:man_facepalming:

Problem solved! :slight_smile:

Thatā€™s great. Can you share you configuration script? I could add this to repo so everyone with same device can use it. After stabilization phase (I still working on old samsung unit working with port 2878) I make a post in Share you projects thread.

Of course I will. I still need to update to the latest version and once I get this working Iā€™ll open a PR :slight_smile:

1 Like

PR opened. Thereā€™s some weirdness, which I think has to do with the heatpump and/or the Wi-Fi kit controller itself - In Heat and Cool modes, you can set the temperature, but when in Auto mode, the temperature set is rejected and set to -1000. I checked using curl and there the command is also rejected, so I think this is some hardware peculiarity.

Also, the min and max temperatures are different for the different modes:

  1. In cooling temperature range is 16 to 25
  2. In heating the range is 25 to 55

I guess these ranges canā€™t be set dynamically, although they can be retrieved from the controller itself, as it returns them in the Get /device/DEVICE_ID/temperatures/DEVICE_ID array.

-1000 means that value returned by device is not a number - it is in my code. Iā€™ve added this for debugging to know that returned value was wrong. I can pass value returned by device but then, in such case, template responsible for value conversion will throw an exception :wink:

If those values are returned by device then it should just work, values should be read from device.
If those values are defined by you in configuration file, you can specify more complex template (in template, check current mode and return correct value)

I noticed this. But the device itself is returning the -1000! For whatever reason the returned JSON temperatures are -500 or -1000 in particular cases. They must be communicating some special meaning

Indeed they do out of the box, since the device reports them (except for auto mode)!

I switched to master branch. I believe it is a good time for that. Iā€™ve started a thread in ā€œShare you projectsā€ category. I think we can continue discussion on new thread. What do you think?

Hello. Iā€™m tryng to get the AC TOKEN and is getting the same error. In your next messages you reply it worksā€¦ What did you made?! I cant find the "settings"to include the https. Can you help me please?! Thks