Samsung Galaxy Watch 2 Widget

Hi guys I’m creating this topic to check your feelings about my idea.
I’m tech-loving guy, so I created widget for Samsung Galaxy Active Watch 2 (Tizen).
Probably it will work on other Tizen watches - I will check it later.

For me this widget is awesome, do you think it worth to go forward and make some public version of it.

Screen:
For now this is private version so it may chnage :slight_smile:
Screen_20200605_231357

Info:
There is no regular watch app - I’m lazy and going to the apps and opening it and than using it’s too long way, but if you feel other, let me know.
Main functionality of app is act as widget, so you just put it on widget bar, and with slide you can easli access it.
For now:

  • there are 4 screens with 4 switched (max 16 switches, but easily can make more)
  • there ate 4 places for sensors info (common to all screens, but I can make it same as with switches).
    Widget uses REST API from Home Assistant, and my integration to configure it.
    Config looks like:
hass4tizen:
    sensors:
        sensor.balkon_temperatura: Balcony
        sensor.balkon_wilgotnosc: Balcony
        sensor.balkon_pm2_5: Balcony PM2.5
        sensor.lodowka_temperatura: Fridge
    switches:
        switch.kuchnia_szafki: Kitchen 1
        switch.kuchnia_gora: Kitchen 2
        switch.salon_gora1: Livin room 1
        switch.salon_gora2: Living room 2
        switch.gniazdko2_komp: Comp Light
        switch.tv_backlight: TV Light
        switch.lazienka_wentylator_l1: Toilet W1
        switch.lazienka_wentylator_l2: Toilet W2

Main difficulty for now to solve:

  • pass server address and long REST API secret token to watch widget to allow access API of your HASS (it has to be done over another simple app for smartphone).
  • I have plans to create sever to handle peoples that don’t have public IP (but for now it can work over WiFi in local network, static IP or dynamic dns address)

Download:
Tizen project: http://files.rexo.pl/hass4tizen/Hass4Tizen.zip
Hass addon: http://files.rexo.pl/hass4tizen/kodi_hass4tizen.zip

Info:
In Tizen project you need to change your address and secret in file:
Hass4Tizen\widget\HassWidget\js\app.js
HASS addon put in: custom_components directory.

There is already app like this:

7 Likes

Hi thanks for this :slight_smile:

Does the app or your method work with samsung galaxy active watch 2?

Yes I use Active Watch 2 small and big one.
The project is not yet published but I hope I get some more time to finish stuff and publish code.

1 Like

Brilliant! Really good work, eager to start using it :grinning:

Hey @rexopl any update on this? Can’t wait to try it .

I am very interested in this. Keep us updated!

Hi guys, give me few days I will prepare source code and share here that you can use it ;).

2 Likes

Im verry interested to try too!

It seems very promising.
Looking forward to test it also. :slightly_smiling_face:

Hi guys, added download links, sorry for zips, I just don.t have time and did it fast :).
You need to compile tizen project for your devices.
It was tested only on Active 2 small and big.
When I get more time I will try to optimize click area of buttons.
Feel free to modify this.

1 Like

Hi @rexopl thanks for this. Do we have to compile on our computer and then transfer the file to our phones and then to the watch? Sorry never done this before.

News/update? I’m not able to make it working :\

Hi, I’m checking it. Looks like after update to tizen 5.5 I got black screen on widget.
I think it’s because problems with allow-origin header - request to HASS not working properly now.
I will let you know when its fixed and upload new version.

2 Likes

After investigation i fixed problem.
On HASS device I have nginx to forward local setup on my public domain.
With new version of tizen 5.5 looks like js agent started to validate XMLHttpRequest Access-Control-Allow-* headers.
So I needed to add in location /:

  • options request handler
  • access-control
 location / {

                if ($request_method = OPTIONS ) {
                        add_header Access-Control-Allow-Origin "*" always;
                        add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
                        add_header Access-Control-Allow-Headers 'Origin, X-Requested-With, Content-Type, Accept, Authorization, Accept-Encoding, Accept-Language, Access-Control-Request-Headers, Access-Control-Request-Method, Cache-Control, Connection, Host, Pragma, Sec-Fetch-Des, Sec-Fetch-Mode, Sec-Fetch-Site, User-Agent, Referer, Upgrade, Connection' always;

                        add_header Access-Control-Allow-Credentials "true" always;
                        add_header Content-Length 0;
                        add_header Content-Type text/plain;
                        return 200;
                }

                proxy_pass http://localhost:8123;
                proxy_set_header Host $host;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_hide_header Access-Control-Allow-Origin;
                proxy_hide_header Access-Control-Allow-Methods;
                proxy_hide_header Access-Control-Allow-Headers;
                proxy_hide_header Access-Control-Allow-Credentials;

                add_header Access-Control-Allow-Origin '*' always;
                add_header Access-Control-Allow-Methods "GET, OPTIONS" always;
                add_header Access-Control-Allow-Headers 'Origin, X-Requested-With, Content-Type, Accept, Authorization, Accept-Encoding, Accept-Language, Access-Control-Request-Headers, Access-Control-Request-Method, Cache-Control, Connection, Host, Pragma, Sec-Fetch-Des, Sec-Fetch-Mode, Sec-Fetch-Site, User-Agent, Referer, Upgrade, Connection' always;
                add_header Access-Control-Allow-Credentials "true" always;                
        }

There is some option to set it in hass config but did not tried it:

Anyway I’m preparing new optimized HTML and CSS version that I will update soon.

4 Likes

Is there any development on this? It looks really cool, but there is not much information on how to compile/setup the app/widget…

Hi, I’m looking forward to this version… I would love to control my AR with widget