3D home navigation & control (Unity + Home Assistant)


Hello,
Unity project HA.Unity problem.
thank you, Víctor.

@runtimevic You probably need to add the Newtonsoft.json package: https://docs.unity3d.com/2020.1/Documentation/Manual/com.unity.nuget.newtonsoft-json.html

solution: JSON .NET For Unity :grinning: :grinning: :grinning:

I’ll add it to the readme

1 Like

solution: JSON .NET For Unity :grinning: :grinning: :grinning:

Donel! Info for the required dependency is added to the library.

Hello,
Configure the url & api key.
Where should the url be configured?
and where can I find the api key?

/// The Home Assistant base instance URL.
/// The Home Assistant long-lived access token.

thank you, Víctor.

To generate a password, you can add a ‘legacy_api_password’ auth provider to Home Assistant.

First add the HomeAssistant script to the scene (I use an empty GameObject).
The url and password (api key) can be configured on this HomeAssistant script (in the inspector).

image

Note: The debug url is used when running within Unity, the final build will use the other Url.

Hello,
This is the entry in configuration.yaml for Home Assistant auth:

homeassistant:
auth_providers:
- type: homeassistant
- type: legacy_api_password
api_password: !secret http_password

this is what you have to put in the configuration.yaml ??
thank you, Víctor,

@runtimevic correct

1 Like

Hello,
I don’t know where the error is coming from?
Thank you Victor.

Looks like a connection problem.
The message indicates it received a non-json formatted response from the server (HA; probably a html error message).

Unity_3D_Home_Assistant_Error03

Unity_3D_Home_Assistant_Error05 Unity_3D_Home_Assistant_Error04

I don’t understand why it gives me login error?
Thank you Victor.

already solved, change the password for a token created in long-term home assistant.
Please put it on the github so that the next person does not have this problem and difficulty.
:grinning: :grinning: :grinning:

greetings Victor

Hello,
the light does not come on, he put a button on Unity, I don’t know if it is well configured or what I am doing wrong?
Thank you Victor.

Configuration looks OK (‘light.’ is optional).
Add a light to the scene and connect it to the ‘Scene Light’ property to see if the light toggle works within Unity? Maybe you need to add the Unity Event System?

Another possibility is adding a cube with a default collider and add the HALight script with the ‘on click’ action.

:grinning: :wink: :grinning: :wink:

It’s working ok.
thank you very much, Victor

1 Like

Waiting for my VR Headset to arrive!

12 Likes

Hey thanks @harriedegroot for the unity porting. Used in my project and can’t wait to show you guy what I got soon :grinning:

3 Likes

@vuqnguyen reaaaaallyy curious hehe!

1 Like