lprhodes / homebridge-broadlink-rm

Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
570 stars 285 forks source link

new accessory in homekit: TV_accessory.js #468

Open skop1986 opened 5 years ago

skop1986 commented 5 years ago

Hello, could you add a new accessory? https://github.com/KhaosT/HAP-NodeJS/blob/master/accessories/TV_accessory.js

tommyd75 commented 5 years ago

+1 for this feature!

gchokov commented 5 years ago

Looks like this plugin is not supported anymore :(

AlexanderBabel commented 5 years ago

Hey there,

Im currently working on the support for the new TV accessory. If you want to have a look: https://github.com/AlexanderBabel/homebridge-broadlink-rm

skop1986 commented 5 years ago

Hey there,

Im currently working on the support for the new TV accessory. If you want to have a look: https://github.com/AlexanderBabel/homebridge-broadlink-rm

I replaced your files but I did not have the control buttons, only the inclusion works. and stopped working " pingAddres"

skop1986 commented 5 years ago

my config

{ "platform": "BroadlinkRM", "name": "Broadlink RM", "hideScanFrequencyButton": true, "hideLearnButton": true, "accessories": [ { "name": "TV", "type": "tv", "pingIPAddress": "10.0.1.7", "pingIPAddressStateOnly": true, "pingFrequency": 10, "data": { "off": "26008c00949314361237143613121213141114111214133614351238121314111213141112141114123712131412131211141213121312381114123712381138143611381236150005fc94931238113814361114131213121213121314361237143613121213121314111213141211381411141112131214131212131237141213361435143612371238133614000d05000000000000000000000000", "on": "26008c00949314361237143613121213141114111214133614351238121314111213141112141114123712131412131211141213121312381114123712381138143611381236150005fc94931238113814361114131213121213121314361237143613121213121314111213141211381411141112131214131212131237141213361435143612371238133614000d05000000000000000000000000", "remote": { "select": "2600d200939511391138113911141114111311141213113911381139111411141113111411141114111213141039111411391138121311391138113911141138111411141139110006049593113911391138111412131114111410141139113911381114111411141114111311141114111411391014113911391113113912381138111411391114111311391100060493961138113911391113111411141114111411381238123811131114111412131114111410141114113911141138113911141138113911391113123811141114113811000d05000000000000", "arrowUp": "2600d200939512381139113811141114141111141114103911391138121311141114111411141014141111141114111411381238111411381139123811381139111411141039110006049396113812381139111311141114111411141138113911391113111411141114111411141113111411141114113911381114113911381139143611381114111411391000060593951139113812381114111411131114111411391336113911141114111311141114111411141114111311141139113913111139123811381139113910141114113911000d05000000000000", "arrowDown": "26008c009395113912381039121311141114111312131238113811391114111411141113121311391114111311141114123811381114111411391138113912381014111411391100060493951238113811391114131211131114111411391138113911141114111410141114113911141113121311141139123712131114113911381139113911131114113912000d05000000000000000000000000", "arrowLeft": "2600d200939511391238113812131114111411141014133711391138111411141114111410141312113911141113111412381138131211391312113812381139111311141139110006049592143711391039131211141114111311141139113911381114111411141114101413121139121311131114113911391113133711141138113913371213111311391100060493961039113911381213111411141114111411381139113811141114111411141114111311391114111411141138123811141138111411391138123811141114113811000d05000000000000", "arrowRight": "26008c009395113911381337131211141113111411141139113813371114111411131312131211141138121311141114123812371312113911131139133712371312111411391000060592961336113913351512101414111114111411381436133713121014111413121312131213361312131211141138113914111138111413371337133613121411113912000d05000000000000000000000000", "back": "26008c009395143611381139121311141014111411141238113811391213131210141114111411141114131111391139111311391114123811381139111411131139111411391100060493951139113811391114111411131114141111391138113911141114111311141114111411141114103911391114113811141139113811391114111411381213113911000d05000000000000000000000000", "exit": "2600d200939512381138113911141113111411141114113911381139111411131114111411141138111411391238111311391114111411131139111411141138121311391138120006049395143611381238111411131114111411141139113811391114131111141114111412381114103911391114103911141114111411381114111411351513113911391100060493951436123712381213111411141113111411391238113811141114111411131114143613121138113911141138111412131114113910141411113913121336123811000d05000000000000", "playPause": "2600d200969211391139113811141411111411141311113911391138111411141114111311141139113911381114111411141138111411141114111411381139113911131139120006039396113812381238101411141114111411141138113911391113111412131114111411381238113911131114111411391114111311141114113911381139121311381200060493951139113812381213111411131114111411391138123811141114111410141114113911381238111411141114113812131114111411141039123811381213113911000d05000000000000", "info": "26008c009395123811391138121311141114111411131139113911381114111412131114111311391139113811391139111311141114111411141114111312131139113811391100060493951139123811381213111411141114101412381139113812131114111411141113113912381138123811391113111411141114111411131114111411391138123812000d05000000000000000000000000" }, "powerMode": { "show": "2600460093961138113911391113111412131114111411381139113911131114111411141114113811141114111411141113111411141114113910391139113811391139113811000d050000" }, "volume": { "up": "26008c009296133713371337111413121312131210141139113913371312131211141114101512371139113911141312111411141212131213121114113913371337133713371300060992961139133713371312131113121114111413371337133713121114101411141312113911381239111411141212111413121312111411131337113913371337133713000d05000000000000000000000000", "down": "26008c00929611391238103a101411141114111413121238113911381114111413121312111411391238121213371312131211141312111412121337131213371337133711391100060b92961139133713371312131211141014111411391139133712131114131211131312113911391312133711141114111311141312111411391312113913371238123812000d05000000000000000000000000" } } } ] }

AlexanderBabel commented 5 years ago

The control buttons are available through the tv control toggle in your control centre. If not a restart of your iOS device might help. This part is still in development on Apples side. It has many bugs currently. How does the ping address work? I don't use this function.

skop1986 commented 5 years ago

The control buttons are available through the tv control toggle in your control centre. If not a restart of your iOS device might help. This part is still in development on Apples side. It has many bugs currently. How does the ping address work? I don't use this function.

pingAdress need to know when it is tv on

2019-01-31 22 27 22
AlexanderBabel commented 5 years ago

Alright, I think the issue should be solved now. Just try the update in my repo.

skop1986 commented 5 years ago

The control buttons are available through the tv control toggle in your control centre. If not a restart of your iOS device might help. This part is still in development on Apples side. It has many bugs currently. How does the ping address work? I don't use this function.

I can't figure out how to control the volume! demonstrate how you do it

skop1986 commented 5 years ago

Alright, I think the issue should be solved now. Just try the update in my repo.

I updated but the ping didn't work. in journalim displays the state of tv and the status of the switch's homekit

AlexanderBabel commented 5 years ago

I use the volume buttons in the tv remote. If this is not working restart your phone sometime it hangs up. Also there is a second bug: If you use the volume buttons, it controls your phone volume and the volume of the tv.

AlexanderBabel commented 5 years ago

Regarding the ping: Currently I have no time for further investigation. Therefore I can not help you with this issue at the moment. Sorry for that!

skop1986 commented 5 years ago

Regarding the ping: Currently I have no time for further investigation. Therefore I can not help you with this issue at the moment. Sorry for that!

thank you very much, I'll wait. Hope on you!

tommyd75 commented 5 years ago

How would I be able to have a multi switch for the TV input so when I long press I have options like HDMI 1, 2, and so forth?

AlexanderBabel commented 5 years ago

Yes that will be available. Currently I added two dummy inputs. But in a few days I will add support for it. Stay tuned!

AlexanderBabel commented 5 years ago

Yes that will be available. Currently I added two dummy inputs. But in a few days I will add support for it. Stay tuned!

Hey guys,

I added support for inputs! Now you can configure the inputs through your config. But keep in mind, the current version of iOS is very unstable regarding inputs. It can happen, that you see your inputs as separated accessories. If this happens jut restart your Home App and you're good to go.

I hope everything works. If not please report it!

Regarding the ping address issue: I'll check it later this weekend.

AlexanderBabel commented 5 years ago

Btw:

These are the available input types:


OTHER
HOME_SCREEN
TUNER
HDMI
COMPOSITE_VIDEO
S_VIDEO
COMPONENT_VIDEO
DVI
AIRPLAY
USB
APPLICATION
paskovitch commented 5 years ago

Hi! I copied the new files to the appropriate folder, but I can't reboot the homebridge, typing an error. How do I update my plugin?

AlexanderBabel commented 5 years ago

The simplest way is to use npm: npm i -g git+https://github.com/AlexanderBabel/homebridge-broadlink-rm.git

If the error still exists, please send me the error message.

paskovitch commented 5 years ago

It's good now! Thanks!

kaosmagix commented 5 years ago

When I try installing your version I get the error messages below. What can I do?

pi@homebridge-1:~ $ npm i -g git+https://github.com/AlexanderBabel/homebridge-broadlink-rm.git
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/lib/node_modules']
npm ERR!   stack:
npm ERR!    "Error: EACCES: permission denied, access '/usr/lib/node_modules'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-02-01T22_01_41_097Z-debug.log
AlexanderBabel commented 5 years ago

Try it again with sudo in front of the command.

kaosmagix commented 5 years ago

Different error:

pi@homebridge-1:~ $ sudo npm i -g git+https://github.com/AlexanderBabel/homebridge-broadlink-rm.git
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git submodule update -q --init --recursive
npm ERR! fatal: Could not change back to '/root/.npm/_cacache/tmp/git-clone-bad96231': Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-01T22_08_02_895Z-debug.log
AlexanderBabel commented 5 years ago

Okay, then try to login in the root account of your pi and try the command again.

kaosmagix commented 5 years ago

Thanks that worked. (after setting a password for root)

tommyd75 commented 5 years ago

How would the multiswtich look in my config file below?

{ "platform":"BroadlinkRM", "name":"Broadlink RM", "hideScanFrequencyButton": true, "hideLearnButton": false, "hideWelcomeMessage": true, "accessories":[

{ "name":"TV", "type":"switch", "data":{ "on":"HEX...", "off":"HEX..." }

},

    {
      "name":"Volume +",
      "type":"switch",
      "enableAutoOff": true,
      "onDuration": 2.5,
      "data": [
        {
          "data": "HEX...",
          "sendCount": 5,
          "interval": 0.3
        }
      ]
    },
    {
      "name":"Volume -",
      "type":"switch",
      "enableAutoOff": true,
      "onDuration": 2.5,
      "data": [
        {
          "data": "HEX....",
          "sendCount": 5,
          "interval": 0.3
        }
      ]
    }
AlexanderBabel commented 5 years ago

I’m sorry, but this issue is about the tv accessory and not the multi switch.

skop1986 commented 5 years ago

Remove old plugin before installation Here's the command to install! npm i -g git+https://github.com/AlexanderBabel/homebridge-broadlink-rm.git --unsafe-perm

tommyd75 commented 5 years ago

Ok, sorry about that, so I have added the TV accessory and it shows up "not supported" on Home app and when I go to control center and select the Apple TV logo I only get my AppleTV it doesn't show the "TV" Do I need to be on iOS beta or just 12.1.3 ? I have updated my homebridge and installed your version of the plugin. Here's my config file

{ "name":"TV3", "type":"tv", "data": { "off": "HEX...", "on": "HEX...", "remote": { "select": "HEX...", "arrowUp": "HEX...", "arrowDown": "HEX...", "arrowLeft": "HEX...", "arrowRight": "HEX...", "back": "HEX...", "exit": "HEX...", "playPause": "HEX...", "info": "HEX..." }, "powerMode": { "show": "HEX..." }, "volume": { "up": "HEX...", "down": "HEX..." }, "inputs": [ { "name": "INPUT 1", "type": "hdmi", "data": "HEX..." } ] } }

AlexanderBabel commented 5 years ago

As mentioned earlier it’s a beta feature. Therefore you need the current Beta of iOS 12.2

tommyd75 commented 5 years ago

Thanks, sorry I missed that.

skop1986 commented 5 years ago

Yes that will be available. Currently I added two dummy inputs. But in a few days I will add support for it. Stay tuned!

Hey guys,

I added support for inputs! Now you can configure the inputs through your config. But keep in mind, the current version of iOS is very unstable regarding inputs. It can happen, that you see your inputs as separated accessories. If this happens jut restart your Home App and you're good to go.

I hope everything works. If not please report it!

Regarding the ping address issue: I'll check it later this weekend.

Hey,any news on ping?

AlexanderBabel commented 5 years ago

Hey,

I’m sorry. I forgot to give you an update. I‘m currently busy with preparing for my exams. Therefore I couldn’t further investigate the issue. If everything goes as expected I can take a look on this again the next weekend.

Thank you for your patience.

skop1986 commented 5 years ago

Hey,

I’m sorry. I forgot to give you an update. I‘m currently busy with preparing for my exams. Therefore I couldn’t further investigate the issue. If everything goes as expected I can take a look on this again the next weekend.

Thank you for your patience.

Hey, any luck?

S474N commented 5 years ago

As mentioned earlier it’s a beta feature. Therefore you need the current Beta of iOS 12.2

Nice job, but why this info is here? I reinstalled all and nothing - have only 12.1.4 :(

skop1986 commented 5 years ago

Need to install ios 12.2, this is a beta firmware

S474N commented 5 years ago

Will wait for public version ;)

I think, why nowhere is warning for this :(

jorgeserna commented 5 years ago

Hi,

Trying this, if I configure a type: "tv" device similar to the ones described here I get this error:

AssertionError [ERR_ASSERTION]: ServiceManager requires the "type" to be provided. at new ServiceManager (/usr/local/lib/node_modules/homebridge-broadlink-rm/helpers/serviceManager.js:7:5) at TVAccessory.setupServiceManager (/usr/local/lib/node_modules/homebridge-broadlink-rm/accessories/tv.js:150:27)

Devices with type "switch" work without problems. Any idea what may be happening? Because type is clearly defined.

jorgeserna commented 5 years ago

In fact, if I simply change my config.json and replace "tv" with "switch", now homebridge starts without problem, and simply lists the device as a switch

skop1986 commented 5 years ago

@AlexanderBabel Hi. Ping and some other features do not work due to the lack of a file tv.test.js in the test folder. Could you please fix this? THANK you! P. S it won't take long)

AlexanderBabel commented 5 years ago

@jorgeserna you need the newest version of Homebridge. Otherwise the plugin won't work.

@skop1986 The test files are not used in the production version of the plugin. Therefore the missing file is not the reason for the issue. Unfortunately I did not found any issues in the tv file and I can not find a quick solution for your issue.

skop1986 commented 5 years ago

@AlexanderBabel Hi. I'm sorry to bother you. I changed in the file tv.js line # 164 with name: "switchTV", on name:" switchState", and ping started working!

AlexanderBabel commented 5 years ago

Thanks a lot. I really had no opportunities to find this issue. I'm sorry for your inconveniences and the bug has been fixed now.

AlexanderBabel commented 5 years ago

I think the issue is hab been solved now and you can close it. If you have any other issues regarding the tv accessory you can open a new one in my fork.

skop1986 commented 5 years ago

@AlexanderBabel

Please fix the plugin

AlexanderBabel commented 5 years ago

Unfortunately that is not possible in my time scope.

skop1986 commented 5 years ago

@AlexanderBabel You just have to change one line number 164

AlexanderBabel commented 5 years ago

As I said, I already did that.

skop1986 commented 5 years ago

@AlexanderBabel

Thank you for your work 👍🏻

S474N commented 5 years ago

Now on iOS 12.2 works, but have problem. Can only switch on/off TV and choose INPUT, but there is no control (volume up/down, channel up/down, mute,...).

If I click on icon TV in Homekit and Settings, there is only button "Zobrazit nastaveni televizoru" (View tv settings).