HA_Desktop_Companion

yeah :smiley:
it was in my original post :smiley:

1 Like

Would be possible to send me your full url to PM i dont need a login to test it just the URL :slight_smile:

Hi @JonatanRek,

This is a really nice initiative from your side, and it’s also nice to see how dedicated you are to support this idea.
I’d like to help on whatever I can. I don’t wanna commit with coding right now, but perhaps I can play as a tester and give ideas and feedback.

I just gave a try and I have some comments. Please don’t take wrong my “suggestion to improvements”, as I’m really trying to help here.
If you prefer, I can report some of those as issues on GitHub, so you can track better your development. Please let me know.

So, let’s go:

  1. The name
    There’s no perfect name in the world, but I would say some comments about “HA Desktop Companion”:
    1a. I’m running in a laptop, not in a desktop. And it works fine. :wink:
    1b. My only desktop at home is running Linux, so the HA Desktop Companion didn’t worked. :stuck_out_tongue:
    I don’t have a better suggestion for a name… I don’t like HA Windows Companion either, so I will think more about this, but I’d like to invite you (and other) to do.

  2. Getting started
    2a. In overall, the process to start using looks OK, but I struggled on finding the EXE file (or the ZIP file containing that). I think you should always keep the latest release on the root of your repository, in order to make clear to people the download link. (Maybe that link should also be on the instructions when you mention the file name).
    => This was reported as Issue #12

2b. I liked the idea of being an simple application which doesn’t requires admin privileges to run, however, I miss the capability to run as an Windows service (way more reliable and available even before the logon) and/or having an icon on the Windows tray, so I can stop, pause, close, change settings, etc.
=> This was reported as Issue #13

2c. Encryption!!!
I saw you already have this on your plans, but I think you should prioritise at least some of the more vulnerable points. I’m OK about my laptop talking to HA unencrypted while I’m on my home network, but not with keys being stored/recorded without any encryption. I would suggest you just remove the keys from log files for now…
=> This was already reported as Issue #11, so I’ve added some comments there.

2d. Signing executables.
The download was blocked by my company’s firewall/anti-virus, I guess due to the existence of a non-signed EXE file (I still have to investigate if this was the real reason). This might not be an issue for the majority of people, but some will have trouble downloading it.

2e. I really like the idea of registering this as a mobile device. It’s not really right for desktops, but it was nice to have my laptop grouped with my other devices (including a Mac laptop).

  1. User interface (UI)
    It’s simple, and I like simplicity, but in this case it is too simple, to the point I have spent some time trying to find the window and understanding what to do, so my comments/suggestions:

image

3a. Add the window to the task bar. Currently it isn’t listed there, so I took a while to find the windows in the back of other windows.
3b. Add some labels to the 2 text fields, so I know what to fill there without having to look on other’s screenshots.
3c. It is missing a title until I connect to HA
3d. More interactive buttons. Like not enabling Register until the text fields have something, disabling when already registered. Rename “Close” to “Quit” or “Exit”, as it’s not only closing the window, it is also ending the application and stopping the sensor, right?
3e. The log checkbox should be a bit bigger and remember the state after restarting.

  1. Sensors/Entities
    4a. Please take a look on the units of temperature sensors… it is “C”, but I would take a look on how to send as a temperature sensor, so users would be able to select the preferred unit.
    4b. The sensor “Currently Active Window” is a bit weird, even more when looking on the history. I would suggest you just record a count of windows opened and add as attributes a matrix with the windows names (so someone will be able to use that info if needed).
    4c. What is the point for “Uptime” in seconds? Would be better to have the last logon time (a timestamp instead) or something like this? This sensor is updated too frequently today and it isn’t that useful (I know I can always disable it).
    4d. I miss a sensor to show the session state (Idle, in use, not logged (only if it’s running as a service), etc.).

So, for now, this is it… I will play a bit more and come back with more feedback.

By the way, I’m having trouble to open the source code… Are you using Visual Studio? Which version?

Again, thank you very much for your great work.

All of those questions are valid I will try to go threw them :slight_smile:
my visual studio is image

could you fill your suggestion to Github ? like maybe to issues per task or to github project ?

1 Like

Addressed few issues from forum already :slight_smile:

1 Like

This is a exciting add-on I can’t wait to get working. Right now I get no windows notification.
So far all the sensors and quick keys work fine.
If I press the Test Send Notification Button it pops up a note in my win10 computer so that works.
Mqtt is all connected.
Fire rule wall and port reg is done.
Notifications for the the app are allowed in the control panel.
No errors in either Log files, HA or hass.agent…
Both have been restarted many times.

What could I be missing?

“Notifications: Send a notification with mypc” just does nothing.

I will use GitHub to track my requests/suggestions.

Hi you are mentioning the hass.agent taht is different integration/app) this integration work with native Home Assistant API so no MQTT you are probably in different topic :frowning:

Finally switched Whole Class of Sensors to fully abstract-one now you can confirurate any WMIC query on your computer to speared sensor :slight_smile:

Enxample sensor snipet:

  - platform: wmic
    wmic_path: Win32_Battery
    wmic_selector: BatteryStatus
    wmic_namespace: \\root\CIMV2
    value_map: "Discharging|On AC|Fully Charged|Low|Critical|Charging|Charging and High|Charging and Low|Undefined|Partially Charged"
    name: Battery State
    unique_id: battery_state
    icon: "mdi:battery-minus"
    entity_category: "diagnostic"
    device_class: battery

What do you think of this change ?

1 Like

Addressed few more issues from your list @EdwardTFN random crashes ue to disconnects shoulden be a think no more also active window now report Exe name instead of full text (it future full text will be in attributes)

1 Like

Thanks!!
Where could I find the latest build? Or in which branch are you working on?

Always you can find latest build in Releases: Releases · GamerClassN7/HA_Desktop_Companion · GitHub

I am working on dev ranch (development) master is stable and releases are created from master

1 Like

Hey @JonatanRek - nice going! MQTT ís a pain yea, so I like the idea of just using the API :grin: If you ever need some HA related help let me know (I’m developing HASS.Agent).

Keep up the good work :slight_smile:

I downloaded the latest version and I got this message

So it failed to connect and timed out.

Second attempt gave me this:

Log says:

{"device_id":"axlt2801","app_id":"ha_desktop_companion","app_name":"HA_Desktop_Companion","app_version":"0.0.0.1","device_name":"AXLT2801","manufacturer":"LENOVO","model":"20JH003EMX","os_name":"Microsoft Windows 10 Enterprise","os_version":"Microsoft Windows NT 10.0.19043.0","supports_encryption":false,"app_data":{"push_websocket_channel":true}}
InternalServerError
500 Internal Server Error

Server got itself in trouble
The JSON value could not be converted to System.Text.Json.Nodes.JsonObject. Path: $ | LineNumber: 0 | BytePositionInLine: 3.

My update procedure is to just replace the two files in the zip. Should I delete the old yaml and json file also before trying to start it?

Edit tried to move the two files and start again but that didn’t work either.

Edit. I rolled back to “lets fix all bugs” and it works fine again.

You need to delete everything it will regenerate all necessary stuff, keep using working version if you want and wait for bigger release like next in line will be :slight_smile:

Bud basically delete everything you have on your computer and then to same folder extract new files :slight_smile:

Log you are sending mean that your HA was not able to communicate with APP over API :frowning:

I tested lates version Release Let's share some images :D · GamerClassN7/HA_Desktop_Companion · GitHub

and it is working correctly for me :slight_smile: when correct URL and Token filled in :slight_smile:

:smiley: What The heck :smiley: How did you get to my project ? BTW: your project is So nice basically it was inspiration for mine :slight_smile: Your project is Awesome not mine :slight_smile: (as you can see mosey bugs than features :D)

I have few question are you using in your notification part of HASS a WebSocket ?
Also your APP is running as a service right (that is something i am not able to achieve RN) :smiley: Dow did you manage to run as service and also have UI ?

Not for me.
I can try again later in a new folder to make sure it’s completely clean.
The only files I kept was the icon (which is not included any more in zip) and the log file, but I deleted everything inside the log file before trying to start it.

you don’t need an icon should be everything packed inside new 2 Files
also i created new release so you can try it :slight_smile:

are you using in your notification part of HASS a WebSocket

I’m using an integration in HA, which connects to HASS.Agent’s builtin webserver. It’s a simple request with a json-formatted body that contains some configuration and the message. HASS.Agent then uses Windows’ toast notifications (using this project) to show it.

A much neater way would be using the native app integration to process push notifications.

Also your APP is running as a service

It’s both! The interface is a ‘regular’ application, and there’s a seperate service. Both are developed in .NET 6, the service specifically is a worker service. They communicate using gRPC over named pipes, using this library. Note: that library currently doesn’t support .NET 6, I’m waiting for my pr to be merged. Until then you can manually build it.

If you want to look at the source, this is the staging solution that has the client, service and shared library.

as you can see mosey bugs than features :smiley:

Nevermind that, we have to start somewhere right :grinning_face_with_smiling_eyes:

This version does not even start.
image

Nothing gets written in the log