mother discussion

Plugin to manage the connection to the SEN.se website. It receives information of COOKIE values (temperature, presence, movements, etc.) connected to the MOTHER device and makes them available as device/states.
User avatar
kw123
Posts: 8453
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: mother discussion

Post by kw123 »

Analysis on how cookies <--> Mother <--> SEN.SE website communication works:

Cookies attach to a mother device after being "installed" on the SEN.SE website.
There are 3 sensors in each cookie:
1. Batterie charge level in mV, updated send by mother to SEN.SE every 15 minutes
2. Temperature (value is in Fahrenheit!!), updates send by Mother to SEN.SE every 15 minutes
3. Motion detection with 3 properties, # of moves, intensity and how many seconds activity took updated send by mother to SEN.SE every 10 seconds .. 15 minutes depending on Motion-mode

The "Present/Absent" state is derived from being in Mothers reach or not.

Each time Mother sends info about the states of the cookie sensors to the SEN.SE website it also sends the Signal strength in db/m of the Cookie-Mother communication. (larger negative numbers are lower signal, below -94 connection is lost)

With the help of "Wire Shark" and a Shark Trap Network sniffer hub http://www.amazon.com/gp/product/B00DY7 ... UTF8&psc=1
I did some low level analysts on timing and data formats:

1. structure of data send from Mother to SEN.SE is a http PUT
{"resource" : "events", "method" : "post", "body" : [{"node" : “8d HEX", "timestamp" : "2015-04-25 20:44:43", "feed_type" : "3", "signal" : "-41", "value" : "176,300,95"}]}
(date is in UTC)

2. at startup after UID exchanges ... several basic communications are send like:
{"body": {"stateFrequency": 180, "smileLed": "255,0,0", "serverUrl": "in.sen.se", "rightLed": "200,200,0", "leftLed": "200,200,0", "serverPort": 80, "soundLevel": 50}, "type": "gateway", "resource": "state", "method": "post", "auth": “16 digit hex”} Info of state of Mother etc.

3. once in a while packages like these
{"resource" : "events", "method" : "post", "body" : [{"node" : “8d HEX", "timestamp" : "2015-04-25 20:44:43", "feed_type" : "3", "signal" : "-41", "value" : "176,300,95"}]}
{"resource" : "events", "method" : "post", "body" : [{"timestamp" : "2015-04-25 19:46:42", "feed_type" : "1", "value" : "1"}]}
{"resource" : "events", "method" : "post", "body" : [{"timestamp" : "2015-04-25 19:52:42", "feed_type" : "99", "value" : "Nb Cookie : 5"}]} <== looks like how many cookies near by
are send. They are not linked to specific cookies..


Timings:
general cookie data packages:

Code: Select all

"feed_type"				               "value"			     updated every
1 = alive package			            0/1/2			       58 seconds          values: 0=Absent; 1=Present not linked; 2=Present
2 = battery  4 digits		           4 digit #=3123mV	  15 minutes
3 = motion 1,2,3  			           3 number a,b,c	    15 minutes for "Walk-mode". --10 seconds for "Door-mode" if movement detected 
4 = only for type “door”	           4 digit #  don't know what this is, the data is not available on SEN.SE
5 = temp 4 digits                     9101=91.01F		    15 minutes 


To answer the question, how fast does Mother recognize a cookie coming home:
MM:SS action
15:13 put cookie into aluminum foil = out of reach
18:09 value =0 @ 3 minutes until state goes from "Present" to = "Absent" Value =1
18:48 unwrap cookie
18:57 send value =1 @9 seconds until state goes from "Absent" to "Present not Linked", looks like just connected , weak signal..
18:59 send value =2 @11 seconds until state= "Present"

Similar after removing the battery and waiting until "Absent" status reached, it takes about 20+ seconds to send the "Present" status (value=1 or 2). The cookies not to boot up before they talk to Mother

So it looks as if it should be possible to connect directly to a mother device in your home and not depend on the SEN.SE web server outside to get the data.
BUT I would need to help how to do that. .. beyond my capabilties right now, But I would like to change that.

Any advice fro the "top" experts?

Karl


ps Simon in Switzerland did some cool application of a cookie determining when at sleep..
User avatar
RogueProeliator
Posts: 2520
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: mother discussion

Post by RogueProeliator »

So it looks as if it should be possible to connect directly to a mother device in your home and not depend on the SEN.SE web server outside to get the data.
BUT I would need to help how to do that. .. beyond my capabilties right now, But I would like to change that.
I know that I had suggested this exact thing, and I think it would be cool to eliminate the cloud, just be aware that you may have to plug that sniffer back in later if they update their software -- such as a new parameter for a new device or something.

The basic idea is that you will need to re-direct the communication between the Mother and the server... most likely this is done by Mother connecting to a specific DNS entry, so the easiest way is to use your router and/or internal DNS (if you use OS X Server) to point that DNS entry to the Mac with the plugin. Unfortunately, that will be specific to your router and setup; this may be your biggest issue in terms of support if you go this route since each user will have to examine their own networking setup.

You didn't mention which port it connects to either -- may have to do some port forwarding magic on the router too if it is 80 since OS X would likely be using that be default. Or could configure OS X's Apache to redirect it to your plugin.

Then in Python you will need to setup a server to listen to the traffic and respond appropriate (updating states, etc.) There are a TON of examples of running a server listening for HTTP type traffic in Python with some fairly easy implementations.

SO, it isn't straight forward and I am not sure if you want to take on the support (more so than the development) but it should eliminate reliance on the cloud if you did that.

Adam
Nine
Posts: 78
Joined: Sun Feb 15, 2015 11:54 am
Location: Zurich, Switzerland

Re: mother discussion

Post by Nine »

kw123 wrote: ps Simon in Switzerland did some cool application of a cookie determining when at sleep..
Well... :D it's just a trigger to set my variable "Night" true|false. (I use this variable to dim the lights during the night, set a shorter time to turnOff the lights after no movement was detected, hold the roller blinds closed ...)

This is my setup:
  • installed a cookie for each person under the pillow
  • mesured the temperature for this cokkies
  • plotted a graph to see, about witch temperature-change a person is in bed (see attachment)
  • wrote a litte python script
Trigger-Script:
I decided to trigger at 28° C

Code: Select all

cookie = indigo.devices[493671864] # Cookie Bett Simon
temp = float(cookie.states["Temperature"])
varSleeping = indigo.variables[1832956215] # "SimonSleeping"
varNacht = indigo.variables[1270898724] # "Night"

if temp > 28:
	indigo.variable.updateValue(varSleeping, "true")
	indigo.variable.updateValue(varNacht, "true")

if temp < 28:
	indigo.variable.updateValue(varSleeping, "false")
The variable "Night" is set to true if one person is in bed – but it is only set to false if all persons are up. For that I set another variable "[NAME]Sleeping" for each person and if all variables are false, then the night-mode is turned off.

Simon
Attachments
Temperatur Bett Simon-minute-S1.png
Temperatur Bett Simon-minute-S1.png (16.29 KiB) Viewed 7932 times
MarcoGT
Posts: 1115
Joined: Thu Sep 11, 2014 1:06 pm
Location: Germany

Re: mother discussion

Post by MarcoGT »

Very interesting object...but...the price is not so accessible (well, we all know the home automation is not cheap) :)
User avatar
durosity
Posts: 4392
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: mother discussion

Post by durosity »

Nine wrote: This is my setup:
  • installed a cookie for each person under the pillow
  • mesured the temperature for this cokkies
  • plotted a graph to see, about witch temperature-change a person is in bed (see attachment)
  • wrote a litte python script
Very clever idea! I presume the cookie is not noticable when sleeping?
Computer says no.
Nine
Posts: 78
Joined: Sun Feb 15, 2015 11:54 am
Location: Zurich, Switzerland

Re: mother discussion

Post by Nine »

No, not at all


Gesendet von iPhone mit Tapatalk
User avatar
norcoscia
Posts: 1233
Joined: Wed Sep 09, 2015 5:54 am

Re: mother discussion

Post by norcoscia »

Hi Karl, I'm pretty sure I know the answer to this (and it will be no) but figured I would ask just in case. I received and email from Sen.se today announcing availability of their ThermoPeanut. More info here

https://sen.se/thermopeanut/

Is there any chance these will work with the Mother Plug-in?
_______
Norm
User avatar
kw123
Posts: 8453
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: mother discussion

Post by kw123 »

No.
I asked them. Completely different. No mothers involved only talks Bluetooth.


Sent from my iPhone using Tapatalk
User avatar
norcoscia
Posts: 1233
Joined: Wed Sep 09, 2015 5:54 am

Re: mother discussion

Post by norcoscia »

OK, that is what I expected - thanks for the confirmation...
_______
Norm
User avatar
norcoscia
Posts: 1233
Joined: Wed Sep 09, 2015 5:54 am

Re: mother discussion

Post by norcoscia »

Posting in case anyone is interested - Sen.se has a summer deal - mother for 99 dollars vice the normal 299.

http://sense.cmail20.com/t/i-l-ondrdd-blimihw-r/

Karl - are you still supporting / plan to continue supporting Sen.se mother?
_______
Norm
User avatar
Different Computers
Posts: 2609
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: mother discussion

Post by Different Computers »

Can anyone find a price for individual cookies? Much as I'm not a fan of cloud dependencies, the summer price is pretty attractive for sensors that do so many things. $25 a piece for motion/temp/tilt/vibration/presence sensors is a hell of a deal.

EDIT: found it. $99 for 4. Well hidden!

EDIT 2: Anyone with one of these able to guess about how hard some aftermarket weatherproofing would be for the cookies? I imagine using one as a dog tracker. Luckily my dog hates water, so it doesn't have to be perfectly waterproof.
Last edited by Different Computers on Wed Jul 12, 2017 8:25 am, edited 1 time in total.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
User avatar
Different Computers
Posts: 2609
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: mother discussion

Post by Different Computers »

RogueProeliator wrote:
So it looks as if it should be possible to connect directly to a mother device in your home and not depend on the SEN.SE web server outside to get the data.
BUT I would need to help how to do that. .. beyond my capabilties right now, But I would like to change that.
I know that I had suggested this exact thing, and I think it would be cool to eliminate the cloud, just be aware that you may have to plug that sniffer back in later if they update their software -- such as a new parameter for a new device or something.

The basic idea is that you will need to re-direct the communication between the Mother and the server... most likely this is done by Mother connecting to a specific DNS entry, so the easiest way is to use your router and/or internal DNS (if you use OS X Server) to point that DNS entry to the Mac with the plugin. Unfortunately, that will be specific to your router and setup; this may be your biggest issue in terms of support if you go this route since each user will have to examine their own networking setup.

You didn't mention which port it connects to either -- may have to do some port forwarding magic on the router too if it is 80 since OS X would likely be using that be default. Or could configure OS X's Apache to redirect it to your plugin.

Then in Python you will need to setup a server to listen to the traffic and respond appropriate (updating states, etc.) There are a TON of examples of running a server listening for HTTP type traffic in Python with some fairly easy implementations.

SO, it isn't straight forward and I am not sure if you want to take on the support (more so than the development) but it should eliminate reliance on the cloud if you did that.

Adam
This is a great idea, and one I hate to throw cold water on, but I'd bet a cookie that the mother uses some sort of certificate based communication with the home servers, so doing a redirect would probably just result in errors.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
User avatar
kw123
Posts: 8453
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: mother discussion

Post by kw123 »

I did analyze the traffic that comes out of the mothers with a hardware sniffer between the mother and the switch.
The data is not encrypted
But there is a lot of communinucation going on to tell the mother what to do. Even if one could reroute the traffic there would be a lot of work to simulate the forward and backward messages.
I am still using my 4 mothers and 20 cookies. Mostly as temp sensors now as I switched to ibeacons for presence.
I have 2 in the fridge and one each in my cars, one in my bed to measure how I sleep.



Sent from my iPhone using Tapatalk
User avatar
norcoscia
Posts: 1233
Joined: Wed Sep 09, 2015 5:54 am

Re: mother discussion

Post by norcoscia »

Thanks Karl - BTW - why 4 mothers - can each mother only handle 5 cookies?
_______
Norm
User avatar
kw123
Posts: 8453
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: mother discussion

Post by kw123 »

I think the limit is 20++++


Sent from my iPhone using Tapatalk
Post Reply

Return to “Mother Plugin”