Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neuron mqtt subscriber #467

Open
Sispheor opened this issue May 9, 2018 · 5 comments
Open

Neuron mqtt subscriber #467

Sispheor opened this issue May 9, 2018 · 5 comments

Comments

@Sispheor
Copy link
Member

Sispheor commented May 9, 2018

Connect to a broker, read a value and quit.
Because the existing signal mqtt will trigger an action on each received message.
With a neuron, we could have a message on demand.

@ghost
Copy link

ghost commented May 10, 2018

I still did not had installed Kalliope due to the fact I want fist to stabilize the pairing between my RPi 3 and a bluetooth speaker.

My next requirement will be to install a MQTT broker on the same RPi. For that I found a lightweight broker called Moquette.

As Sispheor said it should then be interresting to get MQTT feedback on demand (Example : "Which day are we ?") but it should also interesting that Kalliope give information when a MQTT has been triggered (Example : ."I detected movement around your car" - message said when I am sleeping "There is water on the ground at ..." - by supposing the wash machine is loosing water).

I have to recognize I still did not had study how MQTT return work but by considering they could be trigger by generating a structured JSON/text file that Kalliope could then use (and archive when the user confirmed he take care about this last information) then I presume it should be easy for Kalliope to react (trigger) when a MQTT result has just be send to the broker. It "just need" to be filter like : will be said on demand, have to been send now (due to security reason), will be said following calendar/time (like when I wake up or come back at home), ...

Then I propose to :

  1. test if Kalliope could work on the same RPi 3 with Moquette and a lightweight Dashboard named Crouton
  2. check how Moquette could generate a file (JSON or text) and
  3. how this "external" file should be structured to allow Kalliope to filter it (on demand, direct, timing, delete or archive (default) when confirmed, ...) then
  4. test Kalliope to extract file content (command line) to say the file content based on the structure used
  5. the archived events could then be asked to Kalliope to remember us (on demand or if new events become reccurent) when something happend.

@Sispheor
Copy link
Member Author

What you are looking for is almost covered in the mqtt signal.

@Sispheor
Copy link
Member Author

And BTW you should at first try kalliope :)

I keep this issue opened because I still want to create a neuron to get one shot info from a broker that save state.

The example is:
A device push the current temperature every minute in the broker.
If we use the mqtt signal, we would make kalliope speaking every minute.
Or we want to have the temperature only on demand.
For this we need a dedicated mqtt neuron.

@ghost
Copy link

ghost commented May 10, 2018

You right.
I want first to get Kalliope available then I will test cling it to another SD card to see if they both Kallipe and Moquette work together. Then with Crouton.

But I still have to stabilize the pairing with the bluetooth speaker before installing Kalliope.

You also right with the answer Kalliope must return on demand from a last MQTT value the broker received.

As you want to take this neuron in one shot this is why I first gave my opinion and then recommand to take care about those aspects :

  1. MQTT events known by the broker does not have to only be announced on demand but well
  2. also at desired moment time/date/calendar (example : I come back home I want Kalliope could tell me what I want to know at this moment and
  3. also at desired events (example : even if I am sleeping (time zone) I want Kalliope could advise me some security alert)

What I means is the fact, for a one shot, your neuron has to foreseen some further aspects than only saying last each MQTT triggered events received on the broker.

As I still does not know how to use neuron and MQTT (I will use as far as possible) I sincerely appreciate your approach I will certainly use. Thanks for your work on this one.

@Sispheor
Copy link
Member Author

The "desired moment" is handled by a signal called "event" .
Please read the doc, play with kalliope and then we'll talk about enhancement.
Thanks.

@Sispheor Sispheor added this to the v0.5.2 milestone May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant