Jump to content


Photo

Home Assistant

Home Assistant HA Hassio

Best Answer jaaem , 25 June 2019 - 08:39 PM

If you do mean homeassistant (https://www.home-assistant.io/), then there is no need for a new plugin. As you stated, Emby is already supported. https://www.home-ass...omponents/emby/

 

If you want to "control HA from Emby", all you need to do is create an automation to trigger off a state change. I did a quick test and it works fine.

Setup Emby in Homeassistant.

 

Make a new automation in the homeassistant gui: Configuration->Automations

Trigger Type: State

entity: media_player.emby_androidtv_livingroom_firetv (or whatever the your emby player is called)

from: paused

to: playing

 

You may need to add another trigger from standby to playing.

 

 

Trigger

Action Type: Call Service

Service: light.turn_off

data:

{

  "entity_id": "light.living_room"
}

 

repeat this for anything else you want to turn off.

Go to the full post


  • Please log in to reply
14 replies to this topic

#1 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 19 June 2019 - 03:39 PM

Hello,

 

I see there is a integration to control Emby from HA and I'm wondering if anybody would consider writing a plugin to control HA from Emby.  



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 140224 posts
  • Local time: 05:17 PM

Posted 19 June 2019 - 03:43 PM

Hi there, to do what exactly?



#3 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 19 June 2019 - 04:15 PM

To do pretty much exactly what Chef's Vera plugin does.   Example would be trigger a script in HA when you press Play in Emby to turn off the lights, close the blinds, etc...



#4 BillOatman OFFLINE  

BillOatman

    Advanced Member

  • Members
  • 491 posts
  • Local time: 05:17 PM

Posted 19 June 2019 - 06:32 PM

I assume you mean google home assistant?

Does it allow programs to send it non verbal commands?  I have the amazon echo devices, and they don't.

I have seen people have apps that when sent commands, speaks the command that the echo or HA   Not sure how else you would do this.

 

Probably better off having the Emby plugin control the lights, blinds, etc directly. Some lights have plugins already that do that.


Edited by BillOatman, 19 June 2019 - 06:35 PM.


#5 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 19 June 2019 - 06:42 PM

Looks like it should be possible through the API:

 

https://developers.h...l_api_rest.html

 

My lights and blinds are Z-Wave, so they can only be controller through a Z-Wave Compatible controller (like Vera or SmartThings).  I'm migrating from Vera because of long term stability issues with the platform.  There also seems to be a vibrant developer community for HA and its completely open.



#6 BillOatman OFFLINE  

BillOatman

    Advanced Member

  • Members
  • 491 posts
  • Local time: 05:17 PM

Posted 19 June 2019 - 08:57 PM

Took a quick look at that api and it should be possible for someone with the equipment.



#7 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 20 June 2019 - 02:15 PM

I might take a stab at this, although I'm rusty.  Perhaps @chef might be interested in some collaboration since he already has this working for Vera?



#8 BillOatman OFFLINE  

BillOatman

    Advanced Member

  • Members
  • 491 posts
  • Local time: 05:17 PM

Posted 20 June 2019 - 02:29 PM

That code would make an excellent jumping off point I would think.



#9 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 21 June 2019 - 01:04 AM

I'll post over in the HA community forum and gauge the interest, althought I might just build it for myself :)

 

I'm rusty, so please forgive terminology, but I have a question:

 

Is the Emby api two-way?  Can it notify when an action occurs (like play, pause) through an exposed requester?


Edited by jasonwilliams, 21 June 2019 - 01:06 AM.


#10 BillOatman OFFLINE  

BillOatman

    Advanced Member

  • Members
  • 491 posts
  • Local time: 05:17 PM

Posted 21 June 2019 - 10:45 AM

Yes. For an example of a Hue plugin that taps into those events, look here.

https://github.com/b...ugin.HueControl



#11 harrv OFFLINE  

harrv

    Advanced Member

  • Members
  • 50 posts
  • Local time: 04:17 PM
  • LocationRocky Mountains

Posted 25 June 2019 - 02:32 PM

I assume you mean google home assistant?

 

You probably know this already now, since your conversation continued, but Google Home and Home Assistant are two different things. Home Assistant is an opensource project that helps integrate and control a lot of things/devices in the home and isn't directly related to Google Home.


  • BillOatman likes this

#12 jaaem OFFLINE  

jaaem

    Member

  • Members
  • 10 posts
  • Local time: 06:17 PM

Posted 25 June 2019 - 08:39 PM   Best Answer

If you do mean homeassistant (https://www.home-assistant.io/), then there is no need for a new plugin. As you stated, Emby is already supported. https://www.home-ass...omponents/emby/

 

If you want to "control HA from Emby", all you need to do is create an automation to trigger off a state change. I did a quick test and it works fine.

Setup Emby in Homeassistant.

 

Make a new automation in the homeassistant gui: Configuration->Automations

Trigger Type: State

entity: media_player.emby_androidtv_livingroom_firetv (or whatever the your emby player is called)

from: paused

to: playing

 

You may need to add another trigger from standby to playing.

 

 

Trigger

Action Type: Call Service

Service: light.turn_off

data:

{

  "entity_id": "light.living_room"
}

 

repeat this for anything else you want to turn off.


Edited by jaaem, 25 June 2019 - 08:52 PM.

  • jasonwilliams likes this

#13 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 25 June 2019 - 09:36 PM

Thanks Jaaem!  I just tried and it works perfectly.  HA is really awesome, and so is Emby!



#14 majorsl OFFLINE  

majorsl

    Advanced Member

  • Members
  • 118 posts
  • Local time: 05:17 PM

Posted 22 September 2019 - 12:20 PM

Funny, I was just looking to do this today with my new HA build and here is this thread.  Thanks!  Is there a list of state changes somewhere?  Obviously above, "playing", "paused"....



#15 jasonwilliams OFFLINE  

jasonwilliams

    Advanced Member

  • Alpha Testers
  • 182 posts
  • Local time: 05:17 PM

Posted 23 September 2019 - 12:01 PM

Yup. It uses the media_player service, so you can create automations in the GUI based on those events.  For example, I have an automation to turn off the lights when the media player state changes from "idle" to "playing".   Here's a screenshot:

 

5d88ec4397125_Capture.png







Also tagged with one or more of these keywords: Home Assistant, HA, Hassio

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users