Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support light entities #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

spect88
Copy link

@spect88 spect88 commented Apr 2, 2021

Hi there,

I've got 2 Nature Remo Minis and use each of them to control A/C as well as a ceiling light from Nitori (similar to this one, the exact models may be different, but the remote controller looks exactly the same).

I've used the integration you've built and A/C worked well out of the box, so thanks a lot for your work! To make the Nitori ceiling light work, I've had to add some code. It's been working well for me for the past few weeks, so I thought I'd send a PR with my changes.

I'm quite new to Home Assistant and home automation in general, so I may have made messed something up - please let me know and I'll try to fix it. I've definitely only tested it on one brand of lights, so it may also turn out that the assumptions I made are not always correct.

Finally, here's an explanation of my setup with Lovelace and Flic buttons.

@yutoyazaki
Copy link
Owner

Hi @spect88 , thanks for your contribution!

I've been little bit busy these days that I haven't had much time to look at your implementation. I will take a closer look when I have time.

@kylehase
Copy link

Hi @spect88 I have both Nitori and Panasonic IR lights. The Nitori has one button for on/off and the Panasonic has discrete on and off buttons. I'm not very familiar with Python or HA integration code but it looks to me like this PR only works for the Nitori type with a single on/off button. Is that correct? Could support for remotes with discrete on/off buttons be added?

@spect88
Copy link
Author

spect88 commented Mar 28, 2022

Hi @kylehase,

it looks to me like this PR only works for the Nitori type with a single on/off button. Is that correct? Could support for remotes with discrete on/off buttons be added?

I've only tested this PR on my Nitori lights and I have no idea how the Nature Remo app treats any other brand of lights, so it's possible your Panasonic lights either won't work or will only work with some strange workaround.

If you've registered your Panasonic lights in the Remo app, could you share what the Remo API returns for GET /1/appliances? (you can censor any secret parts of the output, I'm interested in button definitions)

The API docs are here: https://developer.nature.global/en/overview/

@kylehase
Copy link

Hi Spect. Here's the output of that API call for my light.

{
   "id":"xxx",
   "device":{
      "name":" Bedroom ",
      "id":"xxx",
      "created_at":"2022-03-27T03:44:04Z",
      "updated_at":"2022-03-27T10:49:05Z",
      "mac_address":"xxx",
      "bt_mac_address":"xxx",
      "serial_number":"xxx",
      "firmware_version":"Remo-mini/1.6.2",
      "temperature_offset":0,
      "humidity_offset":0
   },
   "model":{
      "id":"f097ceaa-44b6-4108-a314-22af7ccc87b5",
      "country":"JP",
      "manufacturer":"panasonic",
      "remote_name":"hk9493-ch1",
      "name":"Panasonic LIGHT 024",
      "image":"ico_light"
   },
   "type":"LIGHT",
   "nickname":"Bedroom Light",
   "image":"ico_light",
   "settings":null,
   "aircon":null,
   "signals":[
      
   ],
   "light":{
      "buttons":[
         {
            "name":"on",
            "image":"ico_on",
            "label":"Light_on"
         },
         {
            "name":"off",
            "image":"ico_off",
            "label":"Light_off"
         },
         {
            "name":"on-100",
            "image":"ico_light_all",
            "label":"Light_all"
         },
         {
            "name":"night",
            "image":"ico_light_night",
            "label":"Light_night"
         },
         {
            "name":"bright-up",
            "image":"ico_arrow_top",
            "label":"Light_bright"
         },
         {
            "name":"bright-down",
            "image":"ico_arrow_bottom",
            "label":"Light_dark"
         },
         {
            "name":"colortemp-down",
            "image":"ico_arrow_right",
            "label":"Light_warm"
         },
         {
            "name":"colortemp-up",
            "image":"ico_arrow_left",
            "label":"Light_cold"
         }
      ],
      "state":{
         "brightness":"100",
         "power":"off",
         "last_button":"off"
      }
   }
},

@spect88
Copy link
Author

spect88 commented Apr 1, 2022

Yeah, the code would need to be changed to support that in the form of a light entity. I could attempt that when I have time, but the problem is I don't have the device to test if it works. @kylehase I'd be happy to review the code if you (or someone else) submitted a PR against my branch.

Otherwise, you could try registering the off button as an extra signal (Add New Button in the app) and only using the 2 services provided in this PR.

Repository owner deleted a comment Jan 31, 2024
Repository owner deleted a comment from Przemocny Feb 19, 2024
Repository owner deleted a comment from oninn Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants