SmartIR - Control your Climate, TV and Fan devices via IR/RF controllers

@Vassilis Can you also add smartir light in your project:

I have ir light with this functions:

"ON":"JgBQAAABJZMSExE3EhMRExE4ETgRExE4ETgRExI3EjcSEhISEjcSEhISEjcSEhISEhISExETETgRNhMTETgROBE4ETgROBETEgAFJgABJUYSAA0FAAAAAAAAAAA=" "OFF":"JgBQAAABJpITERM2ExESEhM2EzYTERM2EzYTERM2EjcTERMSEjcSEhETERMROBI3EjcSEhI3EjcSNxI3EhISEhISEjcTERMREgAFJgABJUYSAA0FAAAAAAAAAAA=" "DIMM+":"JgBQAAABKJMSEhI3EhISExE4ETgRExE4ETgRExE4ETgRExETEjcSEhISEjcSEhI3EhIUEBQ1FDUUNRQQFDUUEBQ1FDUUEBQREwAFJAABKEQUAA0FAAAAAAAAAAA=", "DIMM-:"JgBQAAABJpIUEBQ1FBAUEBQ1FDUUEBQ1FDUUEBQ1EzYUERISEjcSEhISEjYTEhMREzYTERM2EzYTNhMREzYTNhMREzYTERMREwAFJQABJ0UUAA0FAAAAAAAAAAA=" "SUN":"JgBUAAABJZITEhI3EhISEhI3EjcSEhI3EjcSEhI3EjcSEhMREzYTERMREzYTNhM2ExETERM2EzYTNhMRExISEhI3EjcSEhISEgAFJgABJUYTAAWLFwANBQAAAAA=" "MOON":"JgBQAAABJJQRExE4ERMRExI3EjcSEhI3EjcSEhI3EjcSEhISEjcSEhISEhISExETERMRExETETgROBE4ETgROBE4ETgROBETEgAFJgABJEcSAA0FAAAAAAAAAAA=" "CT+":"JgBQAAABJpIUEBQ1FBAUEBQ1FDUUERM1FDUUERQ1FDUUEBQQFDUUEBQ1FBAUEBQ1FDUUEBQQFDUUEBQ1FDUUEBQQFDUUNRQQFAAFJAABJ0UUAA0FAAAAAAAAAAA=" "CT-:"JgBQAAABJ5EUEBQ1FBAUEBQ1FDUUERM1FDUVEBQ1FDUUEBQQFDUUEBQ1FBAUEBQQFBAUEBQ1FDUUEBQ1FDUUNRQ1FDUUERMRFAAFJAABJ0QUAA0FAAAAAAAAAAA="

FROM DIMM- to DIMM+ (10x button press)
FROM CT- to CT+ (10x button press)

Whet I press SUN button = DIMM and CT to max
When I press MOON button = DIMM and CT to min

When I use buttons ON and OFF light remember last state.

2 Likes

Does SmartIR support HACS?

Hi
I need to expand my automation and I am wondering if I could use something like the following example from generic thermostat

Ideally I would like, between 19:00 to 22:00 to turn on if the temperature is below 19 celcius
but if the temperature rises more than 22 to turn to low (fan mode). In the same time if it drops to 20 again to turn to mid (fan mode) That’s the idea at least. Can this be done (hopefully) in the one automation, and if yes can you please alter a bit my code?

climate:
  - platform: generic_thermostat
    name: Study
    heater: switch.study_heater
    target_sensor: sensor.study_temperature
    min_temp: 15
    max_temp: 21
    ac_mode: false
    target_temp: 17
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "off"
    away_temp: 16
    precision: 0.1

It can, you could probably adapt something I’m using to automatically adjust the thermostat temperature based on the room temp (my aircon’s temp sensor is not very accurate due to the bad spot it is located).

- id: adjust_climate_temp
  alias: 'Climate - Auto Adjust Temperature'
  trigger:
    - platform: time_pattern
      minutes: '/10'
      seconds: 00
  condition:
    - condition: state
      entity_id: group.people_status
      state: 'home'
    - condition: state
      entity_id: input_boolean.aircon_prevent_adjustment
      state: 'off'
    - condition: or
      conditions:
        - condition: and
          conditions:
            - condition: template
              value_template: "{{ states.climate.airconditioner.state == 'cool' }}"
            - condition: template
              value_template: "{{ not ((states.sensor.living_room_temperature_f.state | float >= (states.input_number.climate_auto_cool.state | float - 1.0)) and (states.sensor.living_room_temperature_f.state | float <= (states.input_number.climate_auto_cool.state | float + 0.5))) }}"
            - condition: or
              conditions:
                - condition: template
                  value_template: "{{ (states.sensor.living_room_temperature_f.state | float < (states.input_number.climate_auto_cool.state | float - 1.0)) and (states.climate.airconditioner.attributes.temperature | int <= 29) and ((states.climate.airconditioner.attributes.temperature | int - states.input_number.climate_auto_cool.state | int) <= 2) }}"
                - condition: template
                  value_template: "{{ (states.sensor.living_room_temperature_f.state | float > (states.input_number.climate_auto_cool.state | float + 0.5)) and (states.climate.airconditioner.attributes.temperature | int >= 19) and ((states.input_number.climate_auto_cool.state | int - states.climate.airconditioner.attributes.temperature | int) <= 2) }}"
        - condition: and
          conditions:
            - condition: template
              value_template: "{{ (states.climate.airconditioner.state == 'heat') }}"
            - condition: template
              value_template: "{{ not ((states.sensor.living_room_temperature_f.state | float >= (states.input_number.climate_auto_heat.state | float - 0.5)) and (states.sensor.living_room_temperature_f.state | float <= (states.input_number.climate_auto_heat.state | float + 1.0))) }}"
            - condition: or
              conditions:
                - condition: template
                  value_template: "{{ (states.sensor.living_room_temperature_f.state | float < (states.input_number.climate_auto_heat.state | float - 0.5)) and (states.climate.airconditioner.attributes.temperature | int <= 29) and ((states.climate.airconditioner.attributes.temperature | int - states.input_number.climate_auto_heat.state | int) <= 2) }}"
                - condition: template
                  value_template: "{{ (states.sensor.living_room_temperature_f.state | float > (states.input_number.climate_auto_heat.state | float + 1.0)) and (states.climate.airconditioner.attributes.temperature | int >= 19) and ((states.input_number.climate_auto_heat.state | int - states.climate.airconditioner.attributes.temperature | int) <= 2) }}"
    - condition: template
      value_template: '{{ ((as_timestamp(now()) - as_timestamp(states.climate.airconditioner.last_changed) | default(0)) | int) > 590 }}'
  action:
    - service_template: >
        {% if (states.climate.airconditioner.state == 'cool') and (states.sensor.living_room_temperature_f.state | float < (states.input_number.climate_auto_cool.state | float - 1.0)) and (states.climate.airconditioner.attributes.temperature | int <= 29) %}
          climate.set_temperature
        {% elif (states.climate.airconditioner.state == 'cool') and (states.sensor.living_room_temperature_f.state | float > (states.input_number.climate_auto_cool.state | float + 0.5)) and (states.climate.airconditioner.attributes.temperature | int >= 19) %}
          climate.set_temperature
        {% else %}
          script.do_nothing
        {% endif %}
      data_template:
        entity_id: climate.airconditioner
        temperature: >
            {% if (states.climate.airconditioner.state == 'cool') and (states.sensor.living_room_temperature_f.state | float < (states.input_number.climate_auto_cool.state | float - 1.0)) and (states.climate.airconditioner.attributes.temperature | int <= 29) %}
              {{ states.climate.airconditioner.attributes.temperature | int + 1 }}
            {% elif (states.climate.airconditioner.state == 'cool') and (states.sensor.living_room_temperature_f.state | float > (states.input_number.climate_auto_cool.state | float + 0.5)) and (states.climate.airconditioner.attributes.temperature | int >= 19) %}
              {{ states.climate.airconditioner.attributes.temperature | int - 1 }}
            {% elif (states.climate.airconditioner.state == 'heat') and (states.sensor.living_room_temperature_f.state | float < (states.input_number.climate_auto_heat.state | float - 0.5)) and (states.climate.airconditioner.attributes.temperature | int <= 29) %}
              {{ states.climate.airconditioner.attributes.temperature | int + 1 }}
            {% elif (states.climate.airconditioner.state == 'heat') and (states.sensor.living_room_temperature_f.state | float > (states.input_number.climate_auto_heat.state | float + 1.0)) and (states.climate.airconditioner.attributes.temperature | int >= 19) %}
              {{ states.climate.airconditioner.attributes.temperature | int - 1 }}
            {% else %}
              {{ states.climate.airconditioner.attributes.temperature | int }}
            {% endif %}
        hvac_mode: >
            {% if (states.climate.airconditioner.state == 'cool') %}
              cool
            {% elif (states.climate.airconditioner.state == 'heat') %}
              heat
            {% else %}
              {{ states.climate.airconditioner.state }}
            {% endif %}

Your conditions will need to be time, rather than mine where I am sensing if the temperature is outside of a set range. Yours would be a LOT simpler then what is posted but its just an example to work off.

Thanks. I really don’t know where or how to even start. I think I have to study your code and how I could alternate to my needs (I have not used templates until now-i find them difficult)

A lot of those templates are just being used to determine whether the current indoor temperature is above or below the set temperature, in order to decide whether to raise or lower the set temperature (or do nothing). You can probably ignore most of that.

Essentially the automation is running ever 10 minutes, evaluating some stuff and then making a decision based on that.

You can do something similiar whereby, the condition just checks if the time is between the times you want it to execute. In the script body, you can then check if it should then raise or lower the fan speed (and also check if the fan is already at the speed you want it; if so dont run).

You could do a simpler script and just execute when the temperature goes above/below a certain range; but if it happens outside that time range, and so never runs, it wont re-execute when it is in that time range; it wont re-execute until the temperature drops or raises back into the valid range and then drops/raises back out of it again.

Glad they worked for you.

How/Where do I submit a set of new codes? I made one for the Mirage ‘Magnum Inverter 19’ series of AC mini split units

You can add the repository manually to hacs. Not sure if it will handle the updates but at least I was able to install like this.

submit the codes as an ‘issue’ on github; https://github.com/smartHomeHub/SmartIR/issues

How to add swing option for the AC? I’m going to make a new code for Daikin, Fujitsu and Mitsubishi (That’s all I have) with swing ON/OFF option. I’m quite understand how code JSON work but I’m not really into python at all, so I’m not really sure if I need to modify climate.py or not

Does somebody use with Google home?
I configured time ago properly and I was able to command volume of TV (Samsung).
From 2 weeks, when I ask Google to change volume, it tell me that is not supported

Any idea?

For the climate part, how do you configure your own code set? At the moment i took a similar model to my AC/ Heater (1160) and then the code set file appeared in the customer_compents directory, after that i updated all of the codes with my own but from the looks of it this file will get overwritten on an update? Can i just create a file with a random number and then use that?

Thanks

Hi guys,
I’m trying to use SmartIR to control a TV LG (1040).
I’ve read a lot of guides and this long thread that is mostly for climate and not for media control.
I have a working mediaplayer entity in my lovelace, that turns on and off, and anything that can be done via the “three dots” menu.

But i dont understand how i can send commands that are in the 1040.json files without copy the base64 code to a script.

Is there a way to send a “previousChannel” instead of a “JgBgAAABK5MTEhMSEzcTEhMSExITEhMSEzcTNhQSEzYUNhQ2FDYUNhQ2ExITEhMSExITEhMSExITEhM3EzcTNhQ2FDYUNhQ2FAAFKwABK0kTAAxjAAErSRMADGIAAStJEwANBQAAAAAAAAAA” ?

Hello could anyone help me on how to add multiple ACs ? I have already add one and it works perfect but I cant add multiple… my config is
#smartir
smartir:

switch:

  • platform: broadlink
    host: 192.168.x.x
    mac: xx:xx:xx:xx:xx:xx
    #works
    climate:
  • platform: smartir
    name: Livingroom AC
    unique_id: livingroom_ac
    device_code: 1000
    controller_data: 192.168.xx.x

#iwant to add the second bellow

  • platform: smartir
    name: Kitchen AC
    unique_id: kitchen_ac
    device_code: 1010
    controller_data: 192.168.x.x

#works
media_player:

  • platform: smartir
    name: Kitchen TV
    unique_id: kitchen_tv
    device_code: 1020
    controller_data: 192.168.x.x
    power_sensor: binary_sensor.tv_power
climate:
  - platform: smartir
    name: Livingroom AC
    unique_id: livingroom_ac
    device_code: 1000
    controller_data: 192.168.xx.x

  - platform: smartir
    name: Kitchen AC
    unique_id: kitchen_ac
    device_code: 1010
    controller_data: 192.168.x.x

Hi Vassilis and thanks for the great component!! problem solved there was a character in the name.
thanks a lot

Hello…i was configuring my broadlink the old way with switches and came across this post. i gave it a try but having following errors while setting up a cable tv box:

i commented out my normal codes to test this in my configurations.yaml

smartir:
switch:
    - platform: broadlink
      host: !secret broadlink1_host
      mac: !secret broadlink1_mac
      
media_player:      
    - platform: smartir
      name: myT_TV
      unique_id: living_room_myT
      device_code: 1001
      controller_data: !secret broadlink1_host
      power_sensor: binary_sensor.tv_power

Can someone please help me figure this out as i imagine its a better way to use the broadlink RM mini. Note that i created a json file code 1001 with my own IR base 64 codes. these has been tested before.

1 Like

Would like to request a feature for the SmartIR platform - pseudo-lights.

Most LED strips and some LED bulbs come with an IR remote. It would be great to be able to trick HA into thinking that these devices were actually light entities where, when a change to the light was requested in HA, it sends it via IR to the device.

I believe that you could fairly easily fake the colour attribute by proximity to the fixed colours available in most LED strips.

I’ve started working on adding a new remote for AC. I recorded all the possible combinations, but at some point they seems to change. Any ideas how can I record the right IR codes? I’m using broadlink RM to record and send the codes.

@Vassilis help will be much appreciated. I would like to contribute to your project with two remotes, but I need to understand what’s the reason for this strange behaviour.

thanks!