Samsung AC Rule

Tags: #<Tag:0x00007f616f97ced0>

Hi, I’m a newbie and a rookie. I’ve not good skills in programming, but i’made to bind my samsung AC to an installation on my MAC.
Now I’d want to set some rules to make the AC do something at specific time.
For example in summertime I need to run dry op_mode for two hours every day from 9 to 11 and then to switch to cool op_mode at 25° in smart co_mode…
and so on.

I’ve read that i can make a crontab ruleset. Can someone help me and write an example rule?
I think this could be helpful also if added to the binding instruction page on github.
Thanks a lot

that’s easy :slight_smile:

rule "start @ 9a.m., April to September" 
    Time cron "0 0 9 * 4-9 ?"

In contrary to normal cron definition, the quartz cron (which is used in openHAB) is to the split second, so the parameters are:

  1. Seconds
  2. Minutes
  3. Hours
  4. Day-of-Month
  5. Month
  6. Day-of-Week
  7. (optional) Year
    Each Parameter could be a comma separated list, 5,10,25 or a range 5-10
    More, you can set up a frequency like “every 5 minutes, beginning at 2” "0 2/5 * * * ?"

You can use the abbreviated names for months and days of week
"0 0/5 7-18 ? * MON-WED,FRI" stands for “every 5 Minutes between 7 a.m. and 6 p.m., only Monday, Tuesday, Wednesday and Friday”
* stands for “every value” and so does ?, but the question mark must be used as day of week or day of month. If none of them is specified, ? must be used for day of week, if day of week is specified and day of month is not, ? must be used for day of month.
There are even more very special commands like “last Sunday” or “third Friday”, see the complete documentation.

Thankyou Udo.
Sorry for borrowing you, but you wrote me a command that make me think:
I sent to the air conditioner a status request and I got a list of attributes that I thought they were usable for commands. In your very kind response You wrote dry_op_mode.sendCommand(ON) and I wonder if there is a list of specific commands to use, because I thought It should be used a AC_FUN_OPMODE command.
How should I proceed?

This is the attribute list:
<DeviceState> <Device DUID="xxxxxxxxxxxx" GroupID="AC" ModelID="AC" > <Attr ID="AC_FUN_ENABLE" Type="RW" Value="Enable"/> <Attr ID="AC_FUN_POWER" Type="RW" Value="Off"/> <Attr ID="AC_FUN_SUPPORTED" Type="R" Value="0"/> <Attr ID="AC_FUN_OPMODE" Type="RW" Value="Dry"/> <Attr ID="AC_FUN_TEMPSET" Type="RW" Value="24"/> <Attr ID="AC_FUN_COMODE" Type="RW" Value="Off"/> <Attr ID="AC_FUN_ERROR" Type="RW" Value="00000000"/> <Attr ID="AC_FUN_TEMPNOW" Type="R" Value="21"/> <Attr ID="AC_FUN_SLEEP" Type="RW" Value="0"/> <Attr ID="AC_FUN_WINDLEVEL" Type="RW" Value="Auto"/> <Attr ID="AC_FUN_DIRECTION" Type="RW" Value="Fixed"/> <Attr ID="AC_ADD_AUTOCLEAN" Type="RW" Value="Off"/> <Attr ID="AC_ADD_APMODE_END" Type="W" Value="0"/> <Attr ID="AC_ADD_STARTWPS" Type="RW" Value="0"/> <Attr ID="AC_ADD_SPI" Type="RW" Value="Off"/> <Attr ID="AC_SG_WIFI" Type="W" Value="Connected"/> <Attr ID="AC_SG_INTERNET" Type="W" Value="Connected"/> <Attr ID="AC_ADD2_VERSION" Type="RW" Value="0"/> <Attr ID="AC_SG_MACHIGH" Type="W" Value="0"/> <Attr ID="AC_SG_MACMID" Type="W" Value="0"/> <Attr ID="AC_SG_MACLOW" Type="W" Value="0"/> <Attr ID="AC_SG_VENDER01" Type="W" Value="0"/> <Attr ID="AC_SG_VENDER02" Type="W" Value="0"/> <Attr ID="AC_SG_VENDER03" Type="W" Value="0"/> </Device>

Ah, I forgot to mention… :slight_smile:

Of course you have to set up appropriate Items which fit your needings. as I don’t own an Air Conditioner at all, I can’t help getting the right channels.

Ah, OK, thankyou again!