Page 1 of 1

Withings sleep with IFTTT to Domoticz

Posted: Sunday 08 September 2019 23:37
by warrior
Hi guys and girls,

I have a Withings sleep monitor (https://www.withings.com/nl/en/sleep)

Works great, can monitor my sleep very well.

Now this device comes with "IFTTT" support , it can give a trigger when you go in bed and one if you leave your bed.

Now i have Domoticz and have set it up to receive a trigger from IFTTT, with help from this page :

https://www.domoticz.com/wiki/IFTTT_int ... h_Domoticz.

so i created a dummy switch which should be triggerd by IFTTT

made a special user in domoticz so IFTT can swith the virtual switch "Dummytest"'
and i made webhook at IFTTT with the following url :

all between "<" and ">" are private

https://<my publicdomoticzip>:443/json.htm?<usernameandpasword>&type=command&param=udevice&idx=1490&nvalue=1&svalue=DummyTest
the user name and pasw are 64 bit encoded.

Now i can see in my domoticz log IFTTT can reach my domoticz but the switch is not working

Does anyone know the correct url should be ?
or point me at a page with better instructions ?
Have been trying to fix this for many hours, serached this forum
googled also etc.

Thanks in advance

Re: Withings sleep with IFTTT to Domoticz

Posted: Monday 09 September 2019 0:16
by waaren
warrior wrote: Sunday 08 September 2019 23:37 .. Now i have Domoticz and have set it up to receive a trigger from IFTTT
Does anyone know the correct url should be ?
https://<my publicdomoticzip>:443/json.htm?idx=1490&param=switchlight&switchcmd=On&type=command

Re: Withings sleep with IFTTT to Domoticz

Posted: Monday 09 September 2019 5:55
by ben53252642
That sensor looks pretty cool, I don't yet have anything like that, I'm using a motion sensors logic approach at the moment for Domoticz to determine if I am in bed or not.

Couple of questions:

1) Is it obvious under the bed? Looking at the photos it appears thick?

2) Do you know if the WiFi is inside the part that goes under the bed or a control unit?

Cheers

Re: Withings sleep with IFTTT to Domoticz

Posted: Monday 09 September 2019 20:17
by warrior
waaren wrote: Monday 09 September 2019 0:16
warrior wrote: Sunday 08 September 2019 23:37 .. Now i have Domoticz and have set it up to receive a trigger from IFTTT
Does anyone know the correct url should be ?
https://<my publicdomoticzip>:443/json.htm?idx=1490&param=switchlight&switchcmd=On&type=command
Thanks for the quick reply , one question : were do i put the username and pasword in the url ?

and what kind of rights do i give the user IFTTT in "user settings"' of domoticz ? "Úser" or "admin"'

Re: Withings sleep with IFTTT to Domoticz

Posted: Monday 09 September 2019 20:37
by warrior
ben53252642 wrote: Monday 09 September 2019 5:55 That sensor looks pretty cool, I don't yet have anything like that, I'm using a motion sensors logic approach at the moment for Domoticz to determine if I am in bed or not.

Couple of questions:

1) Is it obvious under the bed? Looking at the photos it appears thick?

2) Do you know if the WiFi is inside the part that goes under the bed or a control unit?

Cheers
1 ) The whole sensor is 62 x 19 cm and is aprox 1 cm thick, you dont feel it at all because you can put it under your matras, its has a small box with the electronics inside , and the rest is like a plastic membrame which gets inflated
at bit , its calibrated autmatic eavh day ( when your not in your bed of course)

my top matras is 8cm and below matras is 10 cm , so it looks like this :

top matras-------------- 6cm
sensor -------------------1cm
Lower matras-----------10 cm

The Wifi is inside the part that goes under the matras, but i looked at my router, its not connected to wifi all the time.
I suspect it will make a short connection when you get into bed, and also a short contact when you leave your bed.

Its a remarkable device , i paid about 60 euro for it when it was on sale in Sweden

you can also find it as a Nokia sleep.

Re: Withings sleep with IFTTT to Domoticz

Posted: Monday 09 September 2019 20:42
by waaren
warrior wrote: Monday 09 September 2019 20:17 Thanks for the quick reply , one question : were do i put the username and pasword in the url ?
and what kind of rights do i give the user IFTTT in "user settings"' of domoticz ? "Úser" or "admin"'

Code: Select all

https://<my publicdomoticz IP>:443/json.htm?username=<coded username>&password=<coded password>&type=command&idx=1490&param=switchlight&switchcmd=On&type=command
I have the user as Admin and do think it's necessary to be able to call the API but not 100% sure if that is really needed. So I suggest you start testing with a user with admin rights and if that works change it to user and test again.

Re: Withings sleep with IFTTT to Domoticz

Posted: Monday 09 September 2019 22:05
by warrior
waaren wrote: Monday 09 September 2019 20:42
warrior wrote: Monday 09 September 2019 20:17 Thanks for the quick reply , one question : were do i put the username and pasword in the url ?
and what kind of rights do i give the user IFTTT in "user settings"' of domoticz ? "Úser" or "admin"'

Code: Select all

https://<my publicdomoticz IP>:443/json.htm?username=<coded username>&password=<coded password>&type=command&idx=1490&param=switchlight&switchcmd=On&type=command
I have the user as Admin and do think it's necessary to be able to call the API but not 100% sure if that is really needed. So I suggest you start testing with a user with admin rights and if that works change it to user and test again.
YES YES YES it works ! , thanks a lot , and it even works with user with user rights

now i can automate even more :-)

Re: Withings sleep with IFTTT to Domoticz

Posted: Tuesday 10 September 2019 0:18
by mschut
Just curious, how did this help you connect Withings Sleep with Domoticz? I do get it for the URL, but how to use this as a switch for Withings? What does this switch show?

Re: Withings sleep with IFTTT to Domoticz

Posted: Tuesday 10 September 2019 18:42
by warrior
mschut wrote: Tuesday 10 September 2019 0:18 Just curious, how did this help you connect Withings Sleep with Domoticz? I do get it for the URL, but how to use this as a switch for Withings? What does this switch show?
Hi, It works like this :

Person gets into bed , Withings sleep sends a message to IFTTT, In IFTTT i made a webhook (the url ) this send a message
to my Domoticz to a virtual switch ( not a real one) in Domoticz . so person in bed switch is on , no person in bed switch is off.

Now with blockly i can let the status of that (virtual )switch control other switches ( like switch of all main lights when person is in Bed) etc.