BTicino smarther thermostat

Hi @fenderislife, you’re more than welcome,

  1. Yes, it must be the public URL pointing to your smarther-auth.php script - as this resource will later be called back by the OAuth remote server to complete the initial authentication procedure. Thus, better if you first test that your script is actually accessible from the Internet, before registering the new application…

  2. In my setup openhabian is the current user I copy the script to the server with, so it is created under that user:group. OH2 instead runs as openhab user, thus I had to change the script user to openab to avoid access errors when the script called from within OH2 tries to update its own json service file. The important thing here is to make sure the script is owned by the same user your OH2 instance runs as. Your feedback on how you’ll solve in your case would be appreciated, and useful to expand my setup instructions :slight_smile:

  3. Keep the quotation marks before and after your key, and escape the quotation mark IN your key using backslash ( \" ). In your example above, this would become:

client_secret="xxxxB\"yyyyyy"

Please note that both the redirect_uri and the notify_url must be public URL. The 1st one I’ve explained it in #1, the 2nd one will later be called by Azure remote cloud to push thermostat status notifications to your OH2 server.

  1. This should be due to wrong configuration of redirect_uri in your smarther-api.sh script. As explained in #3, it must be a public UR and, more, it must be set with the same value as the First Reply URL you specify when registering the application on Legrand’s website.

Hope this helps :wink:

Should you have further questions, please open an issue on my GitHub project.

Cheers

1 Like

This edit is just to write down that thanks to @Mr_Ronfo’s support I managed to make openhab_smarther fully work.

Thank you again Fabio.

1 Like

What is the best feature of this thermostat? Can anyone guide me in buying thermostats?


Work in progress to implement Smarther in Sdomotica

Hello!
I am new about this world, so I got 3 smarter thermostat x8000.
I’d like to create something (maybe by browser) that can (for example) connect every minute to my thermostat and record temperature and state of that and report it to a graph?

Or, how can I know how many times my home temperature drop down during last day?

thanks a lot

Marco

Hi @Mr_Ronfo,
I’m trying to integrate the Smarther in OpenHab2.
Following your instructions on GitHub I had to change the url used, inserting it without the webserver port, as I had installed already a webserver and got a error message with the port.

Now everything ok till point 3.3 - 5, where in executing smarther-api.sh script with get_status I have the following error message:

./smarther-api.sh: line 117:jq: command not found {“rsptype”:"",“rspcode”": 500,“errormsg”:"OAuth2 code is missing or invalid. To restore the authentication flow call the following Url from a browser:http://…

Could you please help?
Thanks!

Hi @Tommyshome, just saw your comment, hope you’ve made some progress since then :wink:

From the posted error msg, it seems that your Linux distribution has no bash jq command installed.
On Raspbian/Debian distros you can install it via sudo apt install jq.

If you need more help, you can also drop me an issue on GitHub and I’ll be happy to assist.

Cheers

@Mr_Ronfo I know it’s not the right place and I apologize but I don’t know how to contact her.
Can you bring this integration to Home Assistant please?
Thank you!

Hi @Mr_Ronfo!
Thanks for the answer! Meanwhile I have resetted the webserver and now I have everything on OpenHab!
I still used the url without the webserver port, but it’s not updating the infos from the Smarther except the first time and when I send a command.

You are asking for someone who uses openHAB and developed a solution using openHAB on an openHAB forum to build something for Home Assistant?

Yes, and first of all I apologized.
Feel free to delete the message if you want, I don’t want to create controversy.
Sorry.

There is nothing wrong with the post and it’s not controversial. But I don’t know what you expect to come of it. Any home automation is a challenge to learn to use let alone code for and openHAB and HA are so different in that regard that it’s a really big ask.

Hi Fabio,

Thank you so much for the wonderful work.
I would be more than happy if you could help me with the following issue. I’ve completed the setup up to the point where i dowwload the authendication.json file and the script has generated the refresh.json file.
The error i am getting from the get_staus script option is the following:

{“statusCode”:401, “message”:“Unauthorized. Supplied access token is invalid or doesn’t include required scope(s).”}

Any idea?

Thanks you,

Makis

Welcome Makis!

Looks like the application you’ve created on Legrand dev portal has no comfort.read and comfort.write scopes selected. Could you please double check that?

Cheers,

Hi Fabio,

Yes that was the issue. I have edited my application now in legrand’s portal and waiting for approval/update.

Thanks a lot

Ciao Fabio,

Thanks again for your great work!
As I wrote you some time ago, I don´t get automatic updates.
When I run

./smarther-api.sh set_subscription

I got that error:

{“rsptype”:“set_subscription”,“rspcode”:409,“errormsg”:"(set_subscription) Conflict"}

What could be wrong?
Thanks

Hi @Tommyshome, the error 409 in set_subscription usually means you already have a subscription already set for your plantId.

Unfortunately you cannot just “change it” or set it twice, so you have to delete the current one first, then you can set a new one:

  1. List the existing subscriptions, to get the value of subscriptionId attribute associated to your plantId, calling:

    ./smarther-api.sh get_subscriptions
    
  2. Delete the current subscription, calling:

    ./smarther-api.sh delete_subscription <subscriptionId>
    
  3. Now you should be able to set a new subscription for the same plantId, via:

    ./smarther-api.sh set_subscription
    

Cheers,

Thanks @Mr_Ronfo!

Unfortunately the delete subscription is not working…

{“rsptype”:“delete_subscription”,“rspcode”:500,“errormsg”:"(delete_subscription) "}

Hi @Tommyshome, sounds a bit strange to me. Would you mind posting what is:

  • the full result of your call to get_subscriptions, and
  • the full command you’ve executed to delete the subscription ?

Use generic labels instead of the actual values of your plantId and subscriptionId if you prefer, as long as you replace same value with the same label :slight_smile:

Cheers,

Hi @Mr_Ronfo,
The result is:

{“rsptype”:“get_subscriptions”,“rspcode”:200,“subscriptions”:[{“plantId”:“XXXXX-YYYYY-XXX-XXX-YYYYYYYYYYY”,“subscriptionId”:“yxyxyx-yxyx-yxxy-yxyx-yxyxyxyx”,“EndPointUrl”:“https://192.168.1.11/smarther/smarther-c2c.php”}]}

./smarther-api.sh delete_subscription yxyxyx-yxyx-yxxy-yxyx-yxyxyxyx