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
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
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
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
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!
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 . 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
Problem solved!
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
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:
- In cooling temperature range is 16 to 25
- 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
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