IHC and Home Assistant tips

In this post I will give some tips about the most asked questions I get for IHC and home assistant, and include examples I have used in my own setup. Basically it is about how the get something from IHC into HA or the other way.

How to turn on Philips hue light (or some other Home Assistant light) using an IHC push button.

The question is often: how do I get my IHC push button into HA? and the short answer is you don’t because HA does not have push buttons – only switches, and that is not what you want. What you want is something that can show the on/off state of the button and trigger an automation when the state changes. For this we have the binary sensor in HA.

First step is to make a binary_sensor for the push button. You do this by manually adding it to the configuration.yaml

  - id: 2382609
    name: mybutton

Name the “mybutton” button whatever you like. You can now see the button in HA as binary_sensor.mybutton. We want to have the button turn on a light called “mylight”. You add an automation to trigger when the button is pressed:

alias: MyLightOn
 - platform: state
   entity_id: binary_sensor.mybutton
   from: 'off'
   to: 'on'
   - service: light.turn_on
       entity_id: light.mylight
       brightness: 175

To configure another ihc button to turn off the light is almost the same, you just replace the light.turn_on with a light.turn_off. Note the “brightness” here is if you have a dimmable light. If the light is a simple on/off your can remove it.

Use a sensor from HA in IHC

IHC does not have wireless sensors like temperature or motion. I have temperature from my heating system (MaxCube) and also some zigbee temperature/humidity and pir sensors.

In this example I want to have a temperature sensor from HA and use it inside IHC. The following automation will trigger when the temperature changes and set the temperature on a float resourse in IHC

- alias: RoomTemperature
  - platform: event
    event_type: state_changed
      entity_id: climate.termostat
  - alias: CopyTemperature
    service: ihc.set_runtime_value_float
      ihc_id: 2210580
      value: '{{ states.climate.termostat.attributes.current_temperature }}'

In this case is the temperature from a climate entity and I use:

 {{ states.climate.termostat.attributes.current_temperature }}

If is was a temperature sensor called “mysensor” it would be

 {{ states.sensor.mysensor.attributes.temperature }}

I HA use the “Developer tools”, States to see the specific attribute for your sensor, it may not be the same.

I use ihc.set_runtime_value_float because temperatures i IHC are float values. The resource id can by any input or output resource on a functionblock in IHC. The type must match the service function, so if you have a pir on/off you use the ihc.set_runtime_value_bool (and the IHC resource should also be a boolean on/off)

The same pattern can be used when you want to use something else from HA inside your IHC function blocks.


When working with templates it can often end in a lot of restarting of HA until the template expression is right. It is a good idea to use the “Template” under “Developer tools” to check your template – then at least you know the syntax is correct before you try it.

Leave a Reply

Your email address will not be published. Required fields are marked *