claritylab / lucida

Speech and Vision Based Intelligent Personal Assistant
Other
4.81k stars 883 forks source link

Clipsal C-bus incorperation #213

Open TheAwsomeMiner2 opened 6 years ago

TheAwsomeMiner2 commented 6 years ago

Hey, is just like to start off my saying I am kinda new to this stuff so any help would be appreciated. My house And literally everything inside it is controlled by a system called C-bus which was created by clipsal. In this system we have network interfaces that brige a network between your regular home internet and a c-bus network which is like your normal house internet with rj45 cables linking diffrent machines to a hub, in this cause we link solid state relays together with switches and everything is powered with something similar to power over Ethernet (refering to the switches being powered by this and not the lights themselves that run on 240v) this allow us to turn lights on, off, dim them (the system is incredibly modular and you just need to run cat 5 cable not 240v cable to all the switches in your house) and do literally anything we want through software provided or through sending commands to a network interface through telnet. Currently I have got made a web application that uses telnet to connect to this network and turn on or off lights as I wish but I was thinking the other day it would be amazing if I could link it to Lucida to get it to turn off lights on command through speech or even through text if I was to say "turn the laundry lights off". Thw idea is it would somehow connect to the clipsal system and send a telnet command saying turn the laundry lights on, but sadly I do not have that much experience in lucidia so I have no idea how to make this possible. A few months back I tried playing with the web front end and things went downhill fast as soon as I tried to edit anything. It would be great to hear people's suggestions and I'm currently on my phone so I don't have access to example commands right now or my current web interface I use to connect to the network so I'm sorry to be a pain. I'll try upload my files tomorrow as an example of how the web interface works with telnet using a program called c-gate. If you ever get the chance go check our these Clipsal c-bus systems, they are incredibly smart but also kinda on the high price side as a 12 channel relay usually costs over $1000 And that's just for a relay and not dimmers or network interfaces but they are great systems when they work.

Thanks in advance, I will post my files tomorrow on this thread Best regards, Jayden

KamalGalrani commented 6 years ago

Hey Jayden

It is very possible to add such a microservice to Lucida. Just follow the instructions on the README file on how to add a microservice. In the microservice, when you receive the text you can use lambda functions to grasp with device to control and what action to take.

Kamal

TheAwsomeMiner2 commented 6 years ago

Hey KamalGalrani, first of all thanks for replying :) I'm still kinda lost figuring out how to do this, I'm not that familiar with any programming languages other then Html, PHP and CSS (which all are very easy to learn), I have uploaded the web front end files for the C-Bus system to this post which shows how it connects to telnet and also an image as you would be unable to see the values it give me without setting up a network of your own. If possible could you help me out with programming a microservice for lucida, xD I know its a big favour so feel free to say no, and if anyone else wants to help out feel free. Thanks in advance again, capture EXAMPLE.zip

Best regards, Jayden

Also I probably need to give credit here, the uploaded files are made by Greig Sheridan for a project called "C-ChangePHP" Edit* The values are referring to if the light is on, off or if its on a certain brightness, the values go from 0-255 and all the labels on the image that don't have a value next to them, don't worry about them, they are mistakes which I am about to remove (It basically means they are not assigned to a relay or dimmer so it cant get a value or status on that light)

KamalGalrani commented 6 years ago

Hey

I have a lot in my platter. Won't be able to help much except solving issues. But I can guide you through the process of making a PHP microservice! That's the best part about Lucida. You can write a microservice in any language of your choice.

Installing Lucida with PHP

The support for PHP isn't built into Lucida by default. So you need to take that into account while installing.

If you haven't installed Lucida or Apache Thrift from source on your system (not even once):

Type the following commands in your terminal.

sudo apt-get install php phpunit git
git clone https://github.com/claritylab/lucida.git
cd lucida
make

If you have installed Lucida or Apache Thrift on your system (even if in past):

Interacting with Lucida core

Have a look at creating a microservice. PHP Thrift tutorial can be found at https://thrift.apache.org/tutorial/php

Writing the logic

You can find some notes on parsing natural language here. You can parse simple sentences using lambda expressions. PHP supports anonymous functions which come in handy while writing lambda expressions.

Kamal