0

Device HTTP

Vitor Morim 6 months ago in bOS Configurator / Devices updated by Manuel Dias Dias 4 months ago 18

Hi,

I would like to be able to connect a Shelly with ComfortClick.
I think the best way was to use an HTTP Device.
But I am not able to configure. Is there an example for me to base myself on?
To make Shelly on / off, just roll a link and to know its status just access a link in JSON.

Thanks

+1

Hi,

I never used Shelly devices, but their documentation looks very detailed:

https://shelly-api-docs.shelly.cloud/#shelly-family-overview

As I don't own any Shelly device, I can try to read some of the documentation, but I won't have the chance to test it out.

And yes, HTTP device is the best way to use with Shelly, so it can be used to send and get status from Shelly devices, by the interpretation of JSON responses.


Best regards

Hi Ricardo,

Thanks for your answer.

When I acess the 192.168.1.90/status, i get this information.

I need the information it stay in blue box.

In the ComfortClick project I put the following:

In "Shelly" Configurations i put this:

Now, I don't now what i need to put in the other things:

This is the first time i use JSON.

If can help me with this information, I am very grateful

Hi,

Can you past the JSON response here in plain text, so I can filter the value to see if it gets you somewhere?

Best regards

Hi Ricardo,

Yes

{"wifi_sta":{"connected":true,"ssid":"CasaMorim","ip":"192.168.1.90","rssi":-77},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"13:48","unixtime":1585662523,"serial":4169,"has_update":false,"mac":"DC4F22608DF2","relays" :[{"ison":false, "has_timer":false, "timer_remaining":0, "overpower":false}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1585662523,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":1}],"ext_sensors":{},"ext_temperature":{},"ext_humidity":{},"temperature":33.67,"overtemperature":false,"tmp":{"tC":33.67,"tF":92.61, "is_valid":"true"},"update":{"status":"idle","has_update":false,"new_version":"20200312-124223/v1.6.1@112262fd","old_version":"20200312-124223/v1.6.1@112262fd"},"ram_total":50328,"ram_free":33856,"fs_size":233681,"fs_free":153361,"uptime":258235}

Thanks

On the Command, write "status" without the ""

On the token, insert:

relays.[0].ison

See if gets something.

On an online json path expression tester, it returns false (the actual value on the response), so hopefully it will work.

Test it out and tell us the feedback. Some of us are having problems with HTTP devices, so I can't promise it will work right away.

Online Json path expression tester used: https://jsonpath.curiousconcept.com/

Ricardo,

It works perfectly. Thanks a lot.


I take this opportunity to ask one more question. To order the On / Off shelly, just turn the following link: http://192.168.1.90/relay/0?turn=off

If i put this in command: 

They send the command and turn off the Shelly, but do this contantanly.


How can I do this using a Boolean?

Thanks again

Perfect! Now you can start the integration of Shelly devices.

For post commands, you need to set the "Send Cyclically" to false, otherwise, as in the picture tells me, you're sending the off command every 1 second. You can use that for the status, but it's not recommended for the post command in this case, as you just want to send the value once.

Cumprimentos compatriota

Ricardo,

Muito obrigado pela ajuda.

Qualquer coisa que possa ser útil, contacte-me por Linkedin, fui eu que lhe enviei um convite.

Cumprimentos

You're welcome.

Let's keep this in English, or other may think we're talking an alien dialect :-P

In the meanwhile we'll exchange contacts on LinkedIn.

Cumpts

Vitor e Ricardo, boa tarde!

Excellent work with the Shelly integration.

Vitor, once you are satisfied with it, please publish this integration as an Example in our Library.

Forte abraço.

Grande abraço Flávio, espero que estejam todos bem.

I totally forgot to mention Vitor that there's a member of ComfortClick who also speaks our alien dialect :-P

The merit goes to Vitor, I just pushed a little bit :-)

All the best


Hello,

Thanks to your contributions, I have successfully activated and deactivated a Shelly 2.5 module, but I cannot see its status "individually".

Let me explain: If I put this command: relay / 0 / command? I can see the status, but of ALL the information together:

["ison": true, "has_timer": true, "overpower": false, "overtemperature": false, "is_valid": true].

It refreshes well and is synchronized at all times, but do you know how I can read that information separately?

I ask you please if you can lend me a hand. By the way, it is the first time that I do something with json. It shows, right? ;)

Thank you very much, greetings!

Hello Pablo,

Take a look at my example.

See if it helps.

Devices Shelly

Hi Vitor.
Thank you very much for the speed and effectiveness of your response. Everything runs perfect.
I have spent my whole life programming industrial PLCs communicated by Modbus. In fact, we almost always do all the home automation with Siemens and it works perfect and more versatile and cheaper than KNX (not just air conditioning, which is typical). So, if you ever need help with this, don't hesitate to ask me.
Muito obrigado Vitor
Cheers

Hi Pablo,


I am also an industrial PLC programmer . You mention you have used Siemens PLC for Home automation. That is something i have also done for a few times already. I would like to ask you ; Did you install Siemens systems without a BUS between devices ? 


Your comments would be much appreciate.

Regards,


M Dias  


Hi Manuel,

I understand that when you say without a BUS, you mean MODBUS RTU. I have been doing it for TCP for many years. It is more comfortable for me but it is also necessary to physically communicate them with UTP cable (It could be done via wifi if you have no other option, but I always try to avoid it).

Regards

Hi Pablo,

I also prefer Modbus TCP.  My initial question was  related more with general home automation like ; wall switches , lights , Shutters etc.. What i understand is that your experience in Home automation was about air  conditioning.

Thank you , have a nice day.

MDias