Skip to content

Instantly share code, notes, and snippets.

@spect88
Last active April 10, 2021 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spect88/54c487c89ca763714dc7914a3411f4c1 to your computer and use it in GitHub Desktop.
Save spect88/54c487c89ca763714dc7914a3411f4c1 to your computer and use it in GitHub Desktop.
Home Assistant + Nature Remo + Nitori ceiling lamp + Flic 2

This is a simplified explanation of the setup I'm using to get rid of the IR remote that came with my Nitori ceiling lamps.

The setup assumes:

  • I never touch the original IR remotes or the 'master' light switches (the ones that cut the power off)
  • I have internet access and Nature Remote Cloud API is working fine (yes, it's not a local setup).

Devices

  • 2x Nitori ceiling light with an IR remote allowing for brightness and color temperature control (similar to this)
  • 2x Nature Remo Mini
  • 1x RaspberryPi 4
  • 4x Flic 2 button

Nature Remo

I've used the official Nature Remo mobile app to set up the lights. By setting them up I mean not only letting the app detect that I'm using Nitori light and giving me some preconfigured buttons, but also going to the other screen to manually register some other buttons that my IR remote has.

Note that Remo doesn't seem to remember any state of my lights, not even if they are currently on. Well, it does seem to remember which button you pressed, but that's not very useful.

Home Assistant

I'm running Home Assistant with docker (homeassistant/raspberrypi4-homeassistant:stable) on a Raspberry Pi 4. I keep it at home, but the setup doesn't require it to be on the same network as Nature Remo - the integration is using the Cloud API, not the local one.

To be able to control Nature Remo, I needed this custom component. The link will get you to a branch on my fork, where I added support for light devices. Hopefully it will get merged upstream at some point. The integration gives me light entities as well as 2 services that I can use to 'press IR remote buttons'.

Flic buttons were supported out of the box.

Flic buttons

I'm running flicd from https://github.com/50ButtonsEach/fliclib-linux-hci on my Raspberry Pi. Note that due to how flicd is implemented, I won't be able to use any other bluetooth devices from that Raspberry Pi (or I could use a bluetooth dongle).

The buttons are in convenient locations - entrance to the room (next to the 'master' light switch, the one that cuts the power off), next to the bed etc.

I'm controlling what each button does using automations (see the yaml config).

Lovelace

I used picture elements cards to expose all the functionality that the IR remote offers in a somewhat compact format. The pictures are in config/www directory (where config is the directory with all the yaml stuff), so that Home Assistant serves them. The main idea behind the card setup is that I've put a bunch of invisible buttons on top of the edited photo of the IR remote. It'd be great if someone better than me at photo editing would help improve the visuals of my remotes (especially the dark one), but for now I'm OK with the ones I made.

- id: bedroom_entrance_1_click
alias: Bedroom entrance flic 1-click
trigger:
- platform: event
event_type: flic_click
event_data:
button_name: flic_80e4da781007
click_type: single
action:
- service: nature_remo.press_light_button
target:
area_id: bedroom
data:
button_name: on_off
mode: single
- id: bedroom_entrance_2_click
alias: Bedroom entrance flic 2-click
trigger:
- platform: event
event_type: flic_click
event_data:
button_name: flic_80e4da781007
click_type: double
action:
- service: nature_remo.press_custom_button
target:
area_id: bedroom
data:
button_name: 安らぎ
mode: single
- id: bedroom_entrance_hold
alias: Bedroom entrance flic hold
trigger:
- platform: event
event_type: flic_click
event_data:
button_name: flic_80e4da781007
click_type: hold
action:
- service: nature_remo.press_custom_button
target:
area_id: bedroom
data:
button_name: 省エネ
mode: single
type: picture-elements
elements:
- type: service-button
service: nature_remo.press_custom_button
title: ''
service_data:
button_name: 省エネ
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 75%
left: 3%
width: 18%
height: 21%
- type: service-button
service: nature_remo.press_custom_button
title: ''
service_data:
button_name: 安らぎ
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 51%
left: 3%
width: 17%
height: 21%
- type: service-button
service: nature_remo.press_custom_button
title: ''
service_data:
button_name: 家事
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 27%
left: 3%
width: 17%
height: 21%
- type: service-button
service: nature_remo.press_custom_button
title: ''
service_data:
button_name: 読書
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 3%
left: 3%
width: 17%
height: 21%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: bright_up
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 27%
left: 35%
width: 30%
height: 18%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: bright_down
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 78%
left: 35%
width: 30%
height: 17%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: color_temp_up
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 43%
left: 23%
width: 15%
height: 37%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: color_temp_down
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 43%
left: 62%
width: 15%
height: 37%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: max
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 50%
left: 41%
width: 18%
height: 23%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: night
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 75%
left: 80%
width: 17%
height: 21%
- type: service-button
service: nature_remo.press_custom_button
title: ''
service_data:
button_name: Dark
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 51%
left: 80%
width: 17%
height: 21%
- type: service-button
service: nature_remo.press_custom_button
title: ''
service_data:
button_name: Dark yellow
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 26%
left: 80%
width: 17%
height: 22%
- type: service-button
service: nature_remo.press_light_button
title: ''
service_data:
button_name: on_off
entity_id: light.nature_remo_bedroom_light
style:
zoom: 5
transform: none
overflow: hidden
top: 2%
left: 79%
width: 18%
height: 22%
- type: state-icon
entity: light.nature_remo_bedroom_light
style:
top: 13%
left: 50%
zoom: 1.5
background: '#b6b2a7'
border-radius: 6px
border: '1px solid #000'
image: /local/light-remote-horizontal.png
dark_mode_image: /local/light-remote-horizontal-dark.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment