Page 1 of 1

Custom dashboard and event processing

Posted: Friday 04 December 2015 19:17
by dcnoren
EDIT: no longer maintained. You can still find this on Github, but for something that is still updated, please see the node.js implementation of this. http://www.domoticz.com/forum/viewtopic ... 38&t=12361



Started as an internal project I never intended on releasing, but figured I might as well put this on github (which becomes public as I don't have private accounts), and clean stuff up. Still very much a work in progress, but thought I'd go ahead and post this.

https://github.com/dcnoren/Domoticz-Home-UI

Requires some configuration, but not a whole lot; although the functionality is setup specifically for my house, so any scenes will not work and may cause chaos on your setup - using wrong IDs, etc - and may even unlock doors - so be very careful with scene functionality and edit/comment/remove any of that code as required. Further, I am abstracting the event system from Domoticz to allow events to be processed within PHP. See readme about connector.php.

Does not use database, but instead "long-polls" the server. This is inefficient for large setups, but as long as only two or three clients are using it, it should be fine. Only intended for internal functionality, do not use on a public server, as there is no authentication or input sanitation.

I have a few tablets mounted on the walls that display this site full-screen. For now, it mostly replicates Domoticz's internal capabilities, although I can get fine-grained event processing and can tie in non-Domoticz-controlled systems and events, as well. Finally, there's built-in logging capabilities, pushing data to systems such as Loggly (free accounts are available).

Comments are welcome, but this is a home-grown project for my specific purposes and will remain as such - but the code may be useful for others.

A few screenshots:
ui-2.png
ui-2.png (26.22 KiB) Viewed 4244 times
ui-1.png
ui-1.png (36.14 KiB) Viewed 4244 times

Re: Custom dashboard and event processing

Posted: Friday 04 December 2015 19:44
by Abbadon
it looks very well, ill try it tommorow :) thanks

Re: Custom dashboard and event processing

Posted: Saturday 05 December 2015 3:07
by dcnoren
Cool, glad you're interested. I'll look forward to your feedback. Made a few updates in the last few hours, so make sure you re-clone if you already downloaded.

Re: Custom dashboard and event processing

Posted: Saturday 05 December 2015 7:50
by Egregius
Another PHP program, nice :)
What do you mean by 'abstracting the event system'?

Re: Custom dashboard and event processing

Posted: Monday 07 December 2015 11:41
by Abbadon
do you have any plans for temperature sensors?

Re: Custom dashboard and event processing

Posted: Wednesday 09 December 2015 2:30
by dcnoren
Abbadon wrote:do you have any plans for temperature sensors?
Yes - in fact, that is my current project. However, I'm addressing it from an event standpoint, although I could list temperatures on the dashboard. What would you find useful?
Egregius wrote:Another PHP program, nice :)
What do you mean by 'abstracting the event system'?
Basically, I find the Blockly events in Domoticz to be limiting, and want to write my own custom scripts. I also don't want to be constrained to Lua or be constrained to the Domoticz system - so I am writing this to allow a user to write their own events in PHP, away from Domoticz. So - in short - not using Domoticz's events, but using my own. Positives and negatives to doing so - but somebody could also just choose to use the dashboard and ignore the events.

Re: Custom dashboard and event processing

Posted: Wednesday 09 December 2015 7:47
by Egregius
Basically the same that I do in my cron.php. Pulling all nessescary data from domoticz, store that in variables and act upon that.
PHP has so many advantages over lua, don't understand why so many stick by it.
Anyhow, I should take a look at your code, maybe I can learn something :)

Re: Custom dashboard and event processing

Posted: Wednesday 09 December 2015 17:03
by dcnoren
Egregius wrote:Basically the same that I do in my cron.php. Pulling all nessescary data from domoticz, store that in variables and act upon that.
PHP has so many advantages over lua, don't understand why so many stick by it.
Anyhow, I should take a look at your code, maybe I can learn something :)
I'll do the same - glad to see some other people agreeing with me on this. I bet your event processing is a bit further along than mine; I started just with the dashboard capability, so I'll be checking out your event capabilities.

Re: Custom dashboard and event processing

Posted: Tuesday 14 June 2016 2:51
by dcnoren
So, I stopped using PHP and migrated this all to NodeJS, and added wit.ai voice processing capabilities. PHP app will no longer be updated.

Requires an MQTT broker, I would suggest using cloudmqtt.com.

https://github.com/dcnoren/domoticz-node