i8beef / homeautio.mqtt.googlehome Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Add I8Beef.CodeAnalysis an fix all warnings
Google have recently added support for blinds
https://developers.google.com/actions/smarthome/guides/blinds
Also:
Hi,
I see that it is possible to work without providing any signing certificate, but as it is recommended to use it, and the instructions to generate one are very easy to follow, I have created a signingKey.pfx file and copy it to the config directory of the app.
But the appsettings.json do not include an example of how to configure this file. The example is set with the 'null' option. So, my question is: should I replace this 'null' with a 'yes'?, with a JSON object of the key settings (defining the file and passPhrase)? or with an array of these JSON objects? (as the wiki explains that it is posible to have multiple certificate records in the config file).
Regards,
Chema
Hey there. Used to work with my GF but today stopped. I had to re add the devices as per GH request and that was it, but now just works with me. Don't know if Google made any change.
After load example template, there are some errors:
Trait 'TemperatureSetting' is missing command param 'thermostatTemperatureSetpointHigh' for command 'action.devices.commands.ThermostatTemperatureSetpoint'
Trait 'TemperatureSetting' is missing command param 'thermostatTemperatureSetpointLow' for command 'action.devices.commands.ThermostatTemperatureSetpoint'
Trait 'TemperatureSetting' is missing command param 'thermostatTemperatureSetpoint' for command 'action.devices.commands.ThermostatTemperatureSetRange'
Add support for WillReportState actually functioning.
The aplicaction works fine, but I have this log "[Information] Removing expired grants" every minute. Is it normal?
Happy new year!
Evaluate IdentityServer4 Quickstart files for those that are not necessary for the implementation. Example, is it really necessary to keep the External Login stuff around? Or is it better to keep it just so its easier to keep it up to date later?
I have two devices: led_hall_power and led_hall_white. led_hall_power - "ON" or "OFF" state, led_hall_white - number in range 0-100.
Questions:
"state": {
"brightness": {
"topic": "openhab/stateUpdates/led_hall_white/state",
"googleType": "numeric",
"valueMap": null?
}
"state": {
"on": {
"topic": "openhab/stateUpdates/led_hall_power/state",
"googleType": "bool",
"valueMap": [
{
"mqtt": "ON",
"type": "value",
"google": true
},
{
"mqtt": "OFF",
"type": "value",
"google": false
}
]
},
"on": {
"topic": "openhab/stateUpdates/led_white_power/state",
"googleType": "bool",
"valueMap": [
{
"mqtt": "0",
"type": "value",
"google": false
},
{
"mqttMin": 1.0,
"mqttMax": 100.0,
"type": "range",
"google": true
}
]
}
}
Draft full device config:
{
"home/hall/strip": {
"id": "home/hall/strip",
"type": "action.devices.types.LIGHT",
"willReportState": true,
"roomHint": "Some Room",
"name": {
"defaultNames": [],
"name": "strip",
"nicknames": []
},
"deviceInfo": {
"manufacturer": "Some Company",
"model": "Some Model",
"hwVersion": "1.0",
"swVersion": "1.0"
},
"traits": [
{
"trait": "action.devices.traits.OnOff",
"attributes": null,
"commands": {
"action.devices.commands.OnOff": {
"on": "nodered/commandUpdates/led_hall_power/command"
}
},
"state": {
"on": {
"topic": "openhab/stateUpdates/led_hall_power/state",
"googleType": "bool",
"valueMap": [
{
"mqtt": "ON",
"type": "value",
"google": true
},
{
"mqtt": "OFF",
"type": "value",
"google": false
}
]
}
}
},
{
"trait": "action.devices.traits.Brightness",
"attributes": null,
"commands": {
"action.devices.commands.BrightnessAbsolute": {
"brightness": "nodered/commandUpdates/led_hall_white/command"
}
},
"state": {
"brightness": {
"topic": "openhab/stateUpdates/led_hall_white/state",
"googleType": "numeric",
"valueMap": [
{
"mqtt": "100",
"type": "value",
"google": 100
},
{
"mqtt": "0",
"type": "value",
"google": 0
}
]
}
}
}
],
"customData": null
},
Reproduce steps:
2019-01-06 12:16:21.078 +03:00 [Error] Connection id ""0HLJJMT9KR9QT"", Request id ""0HLJJMT9KR9QT:0000001D"": An unhandled exception was thrown by the application.
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNullException()
at System.Collections.Concurrent.ConcurrentDictionary`2.ContainsKey(TKey key)
at HomeAutio.Mqtt.GoogleHome.GoogleDeviceRepository.Contains(String deviceId) in /app/HomeAutio.Mqtt.GoogleHome/GoogleDeviceRepository.cs:line 77
at HomeAutio.Mqtt.GoogleHome.Controllers.DevicesController.Edit(String deviceId) in /app/HomeAutio.Mqtt.GoogleHome/Controllers/DevicesController.cs:line 157
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Just a heads up, I get the following errors when starting the docker image on rasperry pi even though I do have these parameters set correctly:
[23:52:13 WRN] GoogleDevices.json issues detected for device bedroom/airpurifier: ["Trait 'FanSpeed' is missing attribute 'availableFanSpeeds' for command 'action.devices.commands.SetFanSpeed'", "Trait 'FanSpeed' is missing required command 'action.devices.commands.Reverse'"] [23:52:13 WRN] GoogleDevices.json issues detected for device kitchen/anova: ["Trait 'TemperatureControl' is missing attribute 'temperatureRange' for command 'action.devices.commands.SetTemperature'"]
Despite this, setting the fan speed or the temperature work fine, so these errors are false. I am pretty sure these errors also prevent configuring from the webui because when saving the trait, the errors popup and the change is never committed to file. So, these traits have to be manually entered in the json file.
I have issue with HomeGraph. Error occurs, when mqtt message received.
In log file:
2018-12-21 08:29:06.078 +03:00 [Information] MQTT message received for topic openhab/stateUpdates/switch_hallway/state: OFF
2018-12-21 08:29:29.113 +03:00 [Error] Unhandled exception while handling application message.
Error in GoogleHomeGraphClient, line 182:
var signingCredentials = new SigningCredentials(securityKey, SecurityAlgorithms.RsaSha256Signature);
System.NotSupportedException: "IDX10634: Unable to create the SignatureProvider.
Algorithm: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', SecurityKey: 'Microsoft.IdentityModel.Tokens.SymmetricSecurityKey'
is not supported."
googleDevices.json
{
"google/home/switch": {
"id": "google/home/switch",
"type": "action.devices.types.SWITCH",
"willReportState": true,
"roomHint": "Some Room",
"name": {
"defaultNames": [],
"name": "my switch",
"nicknames": []
},
"deviceInfo": {
"manufacturer": "Some Company",
"model": "Some Model",
"hwVersion": "1.0",
"swVersion": "1.0"
},
"traits": [
{
"trait": "action.devices.traits.OnOff",
"commands": { "action.devices.commands.OnOff": { "on": "nodered/commandUpdates/switch_hallway_manual/command" } },
"state": {
"on": {
"topic": "openhab/stateUpdates/switch_hallway/state",
"googleType": "bool",
"valueMap": [
{
"mqtt": "ON",
"type": "value",
"google": true
},
{
"mqtt": "OFF",
"type": "value",
"google": false
}
]
}
}
}
]
},
}
I tried to change RsaSha256Signature to HmacSha256Signature, but after that I have error in MqttService at line 110:
System.Net.Http.HttpRequestException: "Response status code does not indicate success: 500 (Internal Server Error)."
What I am doing wrong?
Consider providing an editor interface for managing the googleDevices.json file.
I have a mosquitto server configured with TLS. It allows connections with certificate and with user/password, and I am connecting to it from several type of devices using both options. But when I try to connect from my homeautio docker it fails. I have a "Socket error on client , disconnecting." log in my mosquitto server, and an ERR log in the container:
[15:25:48 ERR] Error while connecting with server.
[15:25:48 INF] Disconnected.
[15:25:48 INF] MQTT Connection closed unexpectedly, reconnecting...
[15:25:48 WRN] MQTT Connection failed, retrying...
I have open a new port in my mosquitto server without TLS. This way mqtt woks fine and I'll go on with this option. But anyway, it's a pity that I could not solve the problem with the TLS.
Would it be possible to have information about the user ID in the mqtt package ?: Because I would like to be able to turn on different devices depending on the Google user.
Finish setting up logging for application.
Trying to implement "action.devices.traits.ColorSetting" trait.
Device configuration looks like:
"home/hall/strip": {
"id": "home/hall/strip",
"type": "action.devices.types.LIGHT",
"willReportState": false,
"roomHint": "Some Room",
"name": {
"defaultNames": [],
"name": "strip",
"nicknames": []
},
"deviceInfo": {
"manufacturer": "Some Company",
"model": "Some Model",
"hwVersion": "1.0",
"swVersion": "1.0"
},
"traits": [
{
"trait": "action.devices.traits.OnOff",
"attributes": null,
"commands": {
"action.devices.commands.OnOff": {
"on": "nodered/commandUpdates/led_hall_power/command"
}
},
"state": {
"on": {
"topic": "openhab/stateUpdates/led_hall_power/state",
"googleType": "bool",
"valueMap": [
{
"mqtt": "ON",
"type": "value",
"google": true
},
{
"mqtt": "OFF",
"type": "value",
"google": false
}
]
}
}
},
{
"trait": "action.devices.traits.Brightness",
"attributes": null,
"commands": {
"action.devices.commands.BrightnessAbsolute": {
"brightness": "nodered/commandUpdates/led_hall_white/command"
}
},
"state": {
"brightness": {
"topic": "openhab/stateUpdates/led_hall_white/state",
"googleType": "numeric",
"valueMap": null
}
}
},
{
"trait": "action.devices.traits.ColorSetting",
"attributes": {
"colorModel": "rgb",
"commandOnlyColorSetting": true
},
"commands": {
"action.devices.commands.ColorAbsolute": {
"color.name": "nodered/commandUpdates/led_hall_color_name/command",
"color.spectrumRGB": "nodered/commandUpdates/led_hall_color/command"
}
},
"state": {
"color.spectrumRgb": {
"topic": "openhab/stateUpdates/led_hall_color/state",
"googleType": "numeric",
"valueMap": null
}
}
}
],
"customData": null
}
}
In the log:
2018-12-23 11:20:59.495 +03:00 [Information] Received EXECUTE intent for commands: action.devices.commands.ColorAbsolute
2018-12-23 11:20:59.567 +03:00 [Information] Executed action method "HomeAutio.Mqtt.GoogleHome.Controllers.GoogleHomeController.Post (HomeAutio.Mqtt.GoogleHome)", returned result "Microsoft.AspNetCore.Mvc.OkObjectResult" in 96.3069ms.
2018-12-23 11:20:59.582 +03:00 [Information] Executing ObjectResult, writing value of type '"HomeAutio.Mqtt.GoogleHome.Models.Response.Response"'.
After that, program restarts. What I'm doing wrong?
Setup AppVeyor build and publish.
Hi there. I just ran the docker but can find a way to access the volumes. I do not see any new folder in the host.
Hello, great project!
I am developing an IoT project with esp8266 and I have been wandering for several weeks with node-red and / or firebase solutions, but none of them seemed to be able to solve all my needs. Especially the OAuth. And this project seems to resolve everything (hopefully :-))
I'm starting with HomeAutio, but there's one thing on the wiki that bothers me. The section entitled 'Maintain the test mode'. So, this is my question.
If I develop my project with homeAutio.Mqtt.GoogleHome, will it be possible to publish it or is there any restriction that forces it to stay in test mode?
Best regards
When add in web interface ColorSetting trait, it throw error:
Trait 'ColorSetting' is missing attribute 'colorTemperatureRange' for command 'action.devices.commands.ColorAbsolute'
In old versions it works perfectly.
Command:
{
"action.devices.commands.ColorAbsolute": {
"color.spectrumRGB": "mqtt_topic"
}
}
State:
{
"color.spectrumRgb": {
"topic": "mqtt_topic",
"googleType": "numeric",
"valueMap": null
}
}
Hey there. Since yesterday the service stopped working.
Checked the logs and said something about tokens expired, i restarted the docker instance and this is what i got in a fresh log:
2018-11-01 00:44:43.846 -03:00 [Information] Loaded with configuration from: appsettings.json, /app/config/appsettings.Production.json
2018-11-01 00:44:46.906 -03:00 [Warning] Using an in-memory repository. Keys will not be persisted to storage.
2018-11-01 00:44:46.922 -03:00 [Warning] Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
2018-11-01 00:44:47.093 -03:00 [Information] Creating key {***REDACTED***} with creation date 2018-11-01 03:44:47Z, activation date 2018-11-01 03:44:46Z, and expiration date 2019-01-30 03:44:46Z.
2018-11-01 00:44:47.225 -03:00 [Warning] No XML encryptor configured. Key {***REDACTED***} may be persisted to storage in unencrypted form.
2018-11-01 00:44:50.093 -03:00 [Information] Restored tokens from "config/tokens.json"
2018-11-01 00:44:51.096 -03:00 [Information] Loaded device configuration from config/googleDevices.json
2018-11-01 00:44:51.559 -03:00 [Information] Service start initiated
2018-11-01 00:44:51.598 -03:00 [Information] MQTT subscribing to the following topics: google/home/#, pola/living/lampara/estado, pola/termotanque/estado, pola/dormitorio/mesita/estado
2018-11-01 00:44:51.666 -03:00 [Information] Started
2018-11-01 00:44:51.684 -03:00 [Information] Service started successfully
2018-11-01 00:44:52.186 -03:00 [Information] MQTT Connection established
2018-11-01 00:44:52.188 -03:00 [Information] Connected.
2018-11-01 00:44:52.227 -03:00 [Information] ManagedMqttClient
2018-11-01 00:44:52.382 -03:00 [Information] MQTT message received for topic google/home/connected: 2
2018-11-01 00:44:52.391 -03:00 [Information] MQTT message received for topic pola/living/lampara/estado: false
2018-11-01 00:44:52.396 -03:00 [Information] MQTT message received for topic pola/termotanque/estado: false
2018-11-01 00:44:52.398 -03:00 [Information] MQTT message received for topic pola/dormitorio/mesita/estado: false
2018-11-01 00:44:52.421 -03:00 [Information] MQTT message received for topic google/home/connected: 2
2018-11-01 00:45:51.731 -03:00 [Information] Removing expired grants
2018-11-01 00:46:51.757 -03:00 [Information] Removing expired grants
2018-11-01 00:47:51.757 -03:00 [Information] Removing expired grants
2018-11-01 00:48:51.759 -03:00 [Information] Removing expired grants
2018-11-01 00:49:51.757 -03:00 [Information] Removing expired grants
Tried to unlinking and relinking the Test app in the GH app but it does not show anymore to relink.
Allow for a MQTT message to trigger a REQUEST_SYNC.
Updated to the latest-arm32 with your script, loaded up to Google Home again flawlessly but when trying to action a switch i get:
2019-01-01 15:47:44.225 -03:00 [Information] Request starting HTTP/1.1 POST http://192.168.1.2:5000/googlehome/smarthome application/json;charset=UTF-8 254
2019-01-01 15:47:45.500 -03:00 [Information] Route matched with "{action = \"Post\", controller = \"GoogleHome\"}". Executing action "HomeAutio.Mqtt.GoogleHome.Controllers.GoogleHomeController.Post (HomeAutio.Mqtt.GoogleHome)"
2019-01-01 15:47:47.199 -03:00 [Information] Request starting HTTP/1.1 GET http://192.168.1.2:5000/googlehome/.well-known/openid-configuration
2019-01-01 15:47:47.386 -03:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.DiscoveryEndpoint" for "/.well-known/openid-configuration"
2019-01-01 15:47:47.761 -03:00 [Information] Request finished in 560.4799ms 200 application/json; charset=UTF-8
2019-01-01 15:47:48.149 -03:00 [Information] Request starting HTTP/1.1 GET http://192.168.1.2:5000/googlehome/.well-known/openid-configuration/jwks
2019-01-01 15:47:48.155 -03:00 [Information] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.DiscoveryKeyEndpoint" for "/.well-known/openid-configuration/jwks"
2019-01-01 15:47:48.317 -03:00 [Information] Request finished in 167.7839ms 200 application/jwk-set+json; charset=UTF-8
2019-01-01 15:47:48.525 -03:00 [Information] Successfully validated the token.
2019-01-01 15:47:48.617 -03:00 [Information] Authorization was successful.
2019-01-01 15:47:49.090 -03:00 [Information] Executing action method "HomeAutio.Mqtt.GoogleHome.Controllers.GoogleHomeController.Post (HomeAutio.Mqtt.GoogleHome)" with arguments (["HomeAutio.Mqtt.GoogleHome.Models.Request.Request"]) - Validation state: Valid
2019-01-01 15:47:49.161 -03:00 [Information] Received EXECUTE intent for commands: action.devices.commands.OnOff
2019-01-01 15:47:49.250 -03:00 [Information] Executed action method "HomeAutio.Mqtt.GoogleHome.Controllers.GoogleHomeController.Post (HomeAutio.Mqtt.GoogleHome)", returned result "Microsoft.AspNetCore.Mvc.OkObjectResult" in 100.1075ms.
2019-01-01 15:47:49.298 -03:00 [Information] Executing ObjectResult, writing value of type '"HomeAutio.Mqtt.GoogleHome.Models.Response.Response"'.
2019-01-01 15:47:54.793 -03:00 [Information] Loaded with configuration from: appsettings.json, /app/config/appsettings.Production.json
2019-01-01 15:47:56.812 -03:00 [Warning] Using an in-memory repository. Keys will not be persisted to storage.
2019-01-01 15:47:56.828 -03:00 [Warning] Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
2019-01-01 15:47:56.899 -03:00 [Information] Creating key {ae40b490-0516-4e1e-bb01-942255e8c822} with creation date 2019-01-01 18:47:56Z, activation date 2019-01-01 18:47:56Z, and expiration date 2019-04-01 18:47:56Z.
2019-01-01 15:47:56.985 -03:00 [Warning] No XML encryptor configured. Key {ae40b490-0516-4e1e-bb01-942255e8c822} may be persisted to storage in unencrypted form.
2019-01-01 15:47:57.717 -03:00 [Information] Starting IdentityServer4 version "2.3.2.0"
2019-01-01 15:47:58.050 -03:00 [Information] Restored tokens from "config/tokens.json"
2019-01-01 15:47:58.257 -03:00 [Information] Using the default authentication scheme "Cookies" for IdentityServer
2019-01-01 15:47:58.677 -03:00 [Information] Loaded device configuration from config/googleDevices.json
2019-01-01 15:47:59.010 -03:00 [Information] Service start initiated
2019-01-01 15:47:59.051 -03:00 [Information] MQTT subscribing to the following topics: google/home/#, pola/dormitorio/mesita/estado, pola/termotanque/estado, pola/living/lampara/estado
2019-01-01 15:47:59.118 -03:00 [Information] Started
2019-01-01 15:47:59.139 -03:00 [Information] Service started successfully
2019-01-01 15:47:59.656 -03:00 [Information] MQTT Connection established
2019-01-01 15:47:59.658 -03:00 [Information] Connected.
2019-01-01 15:47:59.698 -03:00 [Information] ManagedMqttClient
2019-01-01 15:47:59.849 -03:00 [Information] MQTT message received for topic google/home/connected: 0
2019-01-01 15:47:59.858 -03:00 [Information] MQTT message received for topic pola/dormitorio/mesita/estado: false
2019-01-01 15:47:59.864 -03:00 [Information] MQTT message received for topic pola/termotanque/estado: true
2019-01-01 15:47:59.866 -03:00 [Information] MQTT message received for topic pola/living/lampara/estado: false
2019-01-01 15:47:59.900 -03:00 [Information] MQTT message received for topic google/home/connected: 2
and on the app i get "could not connect to XXX"
Followed all the steps in the wiki.
How do i get this rolling?
In the template "action.devices.traits.ColorSetting" trait:
{
"action.devices.commands.ColorAbsolute": {
"color.spectrumHSV.hue": "MQTT_COMMAND_TOPIC",
"color.spectrumHSV.saturation": "MQTT_COMMAND_TOPIC",
"color.spectrumHSV.value": "MQTT_COMMAND_TOPIC"
}
}
Template needs to be like:
{
"action.devices.commands.ColorAbsolute": {
"color.spectrumHSV": {
"hue": "MQTT_COMMAND_TOPIC",
"saturation": "MQTT_COMMAND_TOPIC",
"value": "MQTT_COMMAND_TOPIC"
}
}
}
It's right? If use template, MQTT commands does not sent, because condition does not true on line 162 MqttService.cs:
if (deviceSupportedCommandParams.ContainsKey(parameter.Key))
Same problem with state in template:
{
"color.spectrumHSV.hue": {
"topic": "MQTT_COMMAND_TOPIC",
"googleType": "numeric",
"valueMap": null
},
"color.spectrumHSV.saturation": {
"topic": "MQTT_COMMAND_TOPIC",
"googleType": "numeric",
"valueMap": null
},
"color.spectrumHSV.value": {
"topic": "MQTT_COMMAND_TOPIC",
"googleType": "numeric",
"valueMap": null
}
}
But it throw error in Device.cs on line 77:
// Parameter is a cmplex object
var complexParameterParts = stateParam.Key.Split('.');
if (complexParameterParts.Count() > 2)
throw new System.Exception("Status key contained more than one '.'");
Because complexParameterParts contains:
| complexParameterParts | {string[3]} | string[]
| [0] | "color" | string
| [1] | "spectrumHSV" | string
| [2] | "hue" | string
Hey there. I added my GF as owner of the Google Actions project and she does not have the option to add it in the Google Home app as Home Control devices. I need to add her personal account so she can also control the devices with her mobile, not just using the Google Homes mini at home.
Is this possible?
Thanks!
Hey there. I have HomeAutio in one Pi and the broker in a second one. Rebooted the broker and noticed that my commands stopped working. Checked the log and got lots of:
2018-08-25 16:24:16.613 -03:00 [Warning] Publishing application (e61f3d37-8981-46be-893b-92240696ab6c) message failed.
2018-08-25 16:24:16.620 -03:00 [Warning] Publishing application (b7b98d9e-2872-4c1b-af51-fa8c6123f307) message failed.
...
Had to restart the docker instance to make it work. Would be nice if it auto restarts or somehow handles gracefuly a broker disconnection.
Trying to implement Air Conditioner. New item show in Google home application, but has no any controls, just common information. It works? And problem with action.devices.traits.Modes trait, if add new trait, I can't see any modes to select. Can you help?
{
"availableModes": [{
"name": "mode",
"name_values": [{
"name_synonym": ["mode"],
"lang": "en"
}],
"settings": [{
"setting_name": "Off",
"setting_values": [{
"setting_synonym": ["off"],
"lang": "en"
}]
}, {
"setting_name": "On",
"setting_values": [{
"setting_synonym": ["on"],
"lang": "en"
}]
},
{
"setting_name": "Eco",
"setting_values": [{
"setting_synonym": ["eco"],
"lang": "en"
}]
}
],
"ordered": false
}]
}
{
"action.devices.commands.SetModes": {
"updateModeSettings.input source": "iobroker/javascript/0/test5"
}
}
{
"currentModeSettings.input source": {
"topic": "iobroker/javascript/0/test5",
"googleType": "numeric",
"on": [{
"mqtt": "0",
"type": "value",
"google": "off"
}, {
"mqtt": "1",
"type": "value",
"google": "on"
}, {
"mqtt": "2",
"type": "value",
"google": "eco"
}
]
}
}
When adding my test project on Android Assistant I get redirected to "http://localhost:5000/home/error?errorId=CfDJ8GF3trMtnQJJq8uQjU-AjSMR5PLvET_buYahjyCFfcHYwm12Hctt67tiQeriD3VQpdPUY3sSAXsrBx3F4QGHN2A9E95nIpnd62QMtgdwKi_XVlCJiGxQ1HeQeD_15Qk6JcZhIuD4yzU3dcKhT-91DFt-wvMaOzMIfjHh8GHN5EEJYwNMyquvZMuMnFXMh-Kq3-qLOOXxoyWK2CVA4sTNrqH1uT8Ggw0x9vB_e6l4-cPcFP3FZAumKsgYHPEy2e4VDnClWCdp4zhMAqxJqC_xEMDGpFK8UnTWujXpJNNCI5iPUGqwPE-8SBnJEsRrH31RKjAHHv3tWNbHDX511VmZaSA" instead of to my public facing url. I don't see "localhost" in my configs anywhere (except for in appsettings.json, which is overridden by appsettings.Production.json). What did I do wrong?
Google has changed their requirements for SmartHome implementations, and ReportState is now a REQUIREMENT instead of optional. In addition, reportState for the entire device list MUST be sent AFTER a successful SYNC. Their recommendation seems to be to return a SYNC request, and then "wait up to a minute" to send a full ReportState... implying you cannot send it out of order with the Google Home SYNC response.
This needs to be implemented carefully, and possibly with retry logic (Polly?). Consider splitting off GoogleHomeGraphAPI processing to its own background service at this point to handle asynchronously from the main execution pipelines. Might also have to handle batching (i.e., don't send a ReportState when a FULL ReportState is already underway, locks around ReportState for a single device so you don't send out of order ReportStates for a single device?
Currently using the MQTTNet basic client through the HomeAutio.Mqtt.Core package. In this case though, the WebHost might not crash like the other HomeAutio bridges when that module throws an exception due to different exception handling needs. That could leave the API running, even after the MQTTNet Client has crashed / disconnected.
Consider options here:
Pursuing 2 seems like a better option if its stable, but will probably mean pulling a copy of the HomeAutio.Mqtt.Core implementation that is based on this client instead, so it'll be more work, but likely more ideal, while the ApplicationLifetime MIGHT be easier, but require some research to figure out how to achieve.
I'm using this excellent project in Heroku and I'm facing an issue with the way that the token store is implemented.
Essentially, Heroku (and probably other PaaS providers) cycles the app periodically and as such the ephemeral storage of the container is lost. Because mountable volumes aren't supported and the built in PersistedGrantStore is backed by the file system, any record of issued refresh tokens is also lost, and so google actions fails to refresh its token.
I propose an optional data store for the tokens. The current oauth.tokenStoreFile
key could be deprecated and superseded by a new oauth.tokenStore
key as follows:
"oauth": {
"tokenStore": {
"type": "file",
"tokenStoreFile": "config/tokens.json"
}
...
For something like mongoDB as a token store:
"oauth": {
"tokenStore": {
"type": "mongo",
"connectionString": "mongodb://localhost:27017"
}
...
I intend to fork this repo and implement this for my own use. If desired, I can raise a PR to pull this functionality back in.
I started one, stayed running for a few minutes, on "PORTS" 5000:5000 (as shown in container list) but then constantly restarts and the PORTS column is empty,
When i try to test my app in the Actions console, i get the following error, no matter what i do:
We're sorry, but something went wrong. Please try again. 'mytestappje' left the conversation
Also i look at my access logs on my webserver that it's pointing to. It's not making any requests. What am i missing?
Setup Docker file container and automatic builds.
fanspeed trait is not currently implemented correctly. It seems to be similar to the "mode" and "toggle" traits. one main difference I've seen in docs is that the command parameters seem to use one less nested object than the mode and toggle traits. For example, FanSpeed uses:
"params": { "fanSpeed": "S1"
and the mode trait uses:
"params": { "updateModeSettings": { "drytype": "permpress"
Make sure the oauth implementation is proving and honoring refresh tokens.
See: http://docs.identityserver.io/en/release/topics/refresh_tokens.html
Allow configuration of "RequireSSL"
Flesh out logging of Google requests and responses.
Implement IPersistedGrantStore so that tokens are persisted between deploys.
I have error:
StatusCode: 400, ReasonPhrase: 'Bad Request'
Request have Content-Type: text/plain. This is wrong, need to be Content-Type: application/json.
Method: POST, RequestUri: 'https://homegraph.googleapis.com/v1/devices:requestSync?key=MY_KEY_HERE', Version: 2.0, Content: System.Net.Http.StringContent, Headers:
{
Content-Type: text/plain; charset=utf-8
Content-Length: 73
}
In https://developers.google.com/actions/reference/smarthome/rest/v1/devices/requestSync json looks like:
{
"agentUserId": string,
"async": boolean
}
And in your request:
{"requestId":null,"agent_user_id":"xxx","payload":null}
Why do you pass requestId and payload?
Here is the main part of the log:
Application startup exception: System.ArgumentException: The path in 'value'
must start with '/'.
Parameter name: value
at Microsoft.AspNetCore.Http.PathString..ctor(String value)
....
....
at HomeAutio.Mqtt.GoogleHome.Program.Main(String[] args) in /app/HomeAutio
.Mqtt.GoogleHome/Program.cs:line 45
Create sample googleDevices.json.
Should provide examples for all existing Google Device types, and valueMap examples.
Currently hard coded to use the IdentityServer4 "development certificate", but if others are going to use this it really should give AT LEAST the option (and instructions) to replace this cert with another.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.