Jump to content

Server- Home Automation (HA) Plugin


Recommended Posts

Hi, I've been hoping for a similar thing for KNX which is what I use for exactly the same thing; draw the curtains, dim the lights and mute the door bell.

Would it perhaps be enough to have a simple fork of one of the notifier plugins that simply starts a command with certain parameters, and then use whichever shell scripts, Zwave tools or other we want just to be called from the plugin? Or even better - specify the command line directly in the plugin, making it super universal?

  • Like 1
Link to post
Share on other sites

Sounds like you have a better grasp about the ins and outs than I do. Do you have any experience in this sort of development/programming??

Link to post
Share on other sites

From a Media Browser perspective, all that is needed would be a "Run External Command" plugin, and then that plugin could be called for any event similar to all the events already used. That would be more than plenty.

 

Then the users would be free to call any Z-wave program such as the one snazy2000 refers to, or in my case, call up a small script to send KNX messages, or any other thing only limited by our imagination. The sky's the limit.

 

I haven't written a program in about 20 years, but having had a look at the source code of one of the plugins in github, I would assume that the author of any of the current Notification plugins would be able to write this relatively straight forward. Having said that, I'm a subscriber to the statement that assumption is the mother of all screw-ups, so I'm not really qualified to have any opinions on how "easy" it could be.

 

 -Florux

Link to post
Share on other sites
snazy2000

If there was an example of what it would need to be sent to like a program that already controls zwave (i dont have any devices so i havent got a clue lol) i may be able to create a plugin to send the command to it. 

  • Like 1
Link to post
Share on other sites

If there was an example of what it would need to be sent to like a program that already controls zwave (i dont have any devices so i havent got a clue lol) i may be able to create a plugin to send the command to it. 

 

I have only looked briefly at zWave prior to going with KNX, so I'm not intimately familiar with it. However, there are control servers available for zWave just like there are for KNX and others. Instead of doing too much from your MB3 server, I'd recommend keeping it somewhat centralised.

 

What I have done is control the entire house with a Gira HomeServer (KNX) so that sensors, switches, phones and computers all report into the HomeServer and then, based on the complete, bigger picture, makes an informed decision and acts accordingly. 

I'd recommend some of the same approach in zWave, if possible in your setup.

 

Then all you need to do is to create a simple command that informs zWave that the TV is now showing a movie on the right display, and it dims the lights accordingly.

 

Obviously you do not want it to dim the lights for any and all devices playing a movie, as that would also include the iPads and others. This can fortunately easily be controlled in Media Browsers existing Notification system without modifications. Thus all we really need is a Plugin that calls an external command on an event. 

Then you create either a script or a zWave control program to communicate with the server (or the system) to dim the lights, and call it on the right events. Super flexible, and does not require an update of the plugin every time you make changes to your zWave plugin. 

I've actually got exactly that setup with my Plex installation, and it works rather well. Only exception is that Plex does not have a stable and functioning notification system, so I had to hack it on a separate Linux server, which means it is up to 80 seconds off. No big deal though, but in Media Browser it could be made just perfect, on the seconds if needs be.

 

 -Florux

  • Like 1
Link to post
Share on other sites
techywarrior

I think it depends on the controller hub. I have a Vera and it's all simple web commands. I am sure some of the other controllers are similar.

 

I'm not sure that looking at this as a "z-wave plugin" is the right way. It's probably going to have to be specific to the controller hub. Or if someone gets ambitious and writes a plugin that lets you select from a set of hubs. But each one is going to have it's own command, security, port, etc.

  • Like 1
Link to post
Share on other sites

I think it depends on the controller hub. I have a Vera and it's all simple web commands. I am sure some of the other controllers are similar.

 

I'm not sure that looking at this as a "z-wave plugin" is the right way. It's probably going to have to be specific to the controller hub. Or if someone gets ambitious and writes a plugin that lets you select from a set of hubs. But each one is going to have it's own command, security, port, etc.

 

My point exactly. Isn't that just more proof it would be more flexible to have a very generic "Run external command" plugin, and then have the plugin simply call an external program that talks to whichever controller or hub one happens to have? If not we might end up with a very cluttered Plugin library with multiple plugins for zwave, KNX and others, which will also be a mess to maintain. 

 

What do you think?

 

 -Florux

  • Like 2
Link to post
Share on other sites
techywarrior

Having something that generic would be too hard for people to use. Also, if the controller requires authentication it may be too complex.

 

I suspect that the plugin would need to be specific to the controller in order for it to be usable by the general user.

Link to post
Share on other sites

I've renamed the topic to "Home Automation (HA) Plugin". I agree with Florux, one app could have configuration options to be compatible with a multitude of HA hubs.

Link to post
Share on other sites

Funny you mention Event Ghost Chef... I was about to bring that up. It is one of the few apps I'm using to automate my theater. The Event Ghost Z Wave plugin is written in Python I believe. Maybe (if someone were interested) we could reverse engineer their app to figure out how they are communicating with my Z Wave hub. From what I remember, it was as easy as adding my hub IP address and port and the device ID to control. Can't be too complicated.

 

And yes, Event Ghost is sensing an event (or button press) to send an on/off command to a Z Wave switch to control my black lights.

Edited by Xzener
Link to post
Share on other sites

It would make more sense to have a mbt plugin i would guess then each room is on different zwave. ?

But, if it were a MBS plugin, like in my initial post, when client X presses button X, MBS HA plugin sends command X to control device X. I have multiple devices in various rooms throughout the house, each room has a MB3 client. Controlling scenes to dim or brighten lights... Even turning off an outlet in my teenagers room, cutting power to all electronic devices at a certain time. ;)

Link to post
Share on other sites

Xzener is right, a server plugin could monitor for any client remote control actions (ie. Playback started/stopped/resumed etc.)

 

If zwave is co trolled by ip and port commands, all that has to happen is an event listener server plugin which sends out customizable commands to zwave.

 

Unfortunately, I never got really good at attaching event arguments from the server to an application. It was alite harder then declaring delegate subroutines.

 

If someone could give an example in server events, it is possible.

  • Like 1
Link to post
Share on other sites

Might be below what you are talking about but I use Milight/Easy bulb/limitlessled WiFi bulbs. Currently use tasker and autovoice, with eventghost. If I understand you all correctly, this hyperthetical plugin could send a signal/command to eventghost to dim the lights when a movie is played. That would be awesome.

Link to post
Share on other sites
techywarrior

What you guys are talking about (for instance making a plugin that sends a command to eventghost) is useful but not really a HA plugin. It would be much better if a plugin was written to directly interface with each HA controller. That way it could get the list of events or devices and you could tell it what you want to do directly. That is much easier from a user perspective then configuring a plugin to talk to another program to talk to the HA controller.

Link to post
Share on other sites

Might be below what you are talking about but I use Milight/Easy bulb/limitlessled WiFi bulbs. Currently use tasker and autovoice, with eventghost. If I understand you all correctly, this hyperthetical plugin could send a signal/command to eventghost to dim the lights when a movie is played. That would be awesome.

I wrote one last year actually, but then the server code changed and I cohld t get events from the server working...

 

We could use Eventghost, sure, but also I think that with zwave hardware, Eventghost could be left out of the equation all together.

Link to post
Share on other sites
techywarrior

I don't think you should say "zwave" that generically since there are a lot of different controllers that have different interfaces.

 

I'd be happy to help someone create a Vera plugin (and if we design/built it right we could then expand it to other controllers). I can test and possibly help code. Probably more along the lines of logic and getting the Vera specific commands then the plugin itself since I don't really know .NET.

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...