Closed phurth closed 9 months ago
Please update to the latest version of the addon, which adds some diagnostics in some state entities.
Request Platform API State
button there; click it once and wait a couple of secondsStatus
entity that is listed under your space heater and get its entity name. The default is probably something like sensor.space_heater_status
.Then evaluate the following home assistant template by visiting Developer Tools | Template
, replacing the entity name with what yours actually is:
{{
{
"meta": state_attr('sensor.space_heater_status', 'platform_metadata'),
"state": state_attr('sensor.space_heater_status', 'platform_state'),
}
}}
It should output a large-ish json blob, please share that here.
That should tell me whether the device gives us enough information to understand which units are in use for the returned data.
JSON below:
{
"meta": {
"capabilities": [
{
"alarmType": null,
"eventState": null,
"instance": "powerSwitch",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "on",
"value": 1
},
{
"name": "off",
"value": 0
}
]
},
"type": "devices.capabilities.on_off"
},
{
"alarmType": null,
"eventState": null,
"instance": "oscillationToggle",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "on",
"value": 1
},
{
"name": "off",
"value": 0
}
]
},
"type": "devices.capabilities.toggle"
},
{
"alarmType": null,
"eventState": null,
"instance": "nightlightToggle",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "on",
"value": 1
},
{
"name": "off",
"value": 0
}
]
},
"type": "devices.capabilities.toggle"
},
{
"alarmType": null,
"eventState": null,
"instance": "brightness",
"parameters": {
"dataType": "INTEGER",
"range": {
"max": 100,
"min": 1,
"precision": 1
},
"unit": null
},
"type": "devices.capabilities.range"
},
{
"alarmType": null,
"eventState": null,
"instance": "colorRgb",
"parameters": {
"dataType": "INTEGER",
"range": {
"max": 16777215,
"min": 0,
"precision": 1
},
"unit": null
},
"type": "devices.capabilities.color_setting"
},
{
"alarmType": null,
"eventState": null,
"instance": "nightlightScene",
"parameters": {
"dataType": "ENUM",
"options": [
{
"name": "Flame",
"value": 1
},
{
"name": "Rainbow",
"value": 2
},
{
"name": "Rhythm",
"value": 3
},
{
"name": "Easy",
"value": 4
},
{
"name": "Sleep",
"value": 5
}
]
},
"type": "devices.capabilities.mode"
},
{
"alarmType": null,
"eventState": null,
"instance": "targetTemperature",
"parameters": {
"dataType": "STRUCT",
"fields": [
{
"dataType": "ENUM",
"defaultValue": 0,
"fieldName": "autoStop",
"options": [
{
"name": "Auto Stop",
"value": 1
},
{
"name": "Maintain",
"value": 0
}
],
"required": false
},
{
"dataType": "INTEGER",
"defaultValue": null,
"fieldName": "temperature",
"range": {
"max": 30,
"min": 5,
"precision": 1
},
"required": true,
"unit": null
},
{
"dataType": "ENUM",
"defaultValue": "Celsius",
"fieldName": "unit",
"options": [
{
"name": "Celsius",
"value": "Celsius"
},
{
"name": "Fahrenheit",
"value": "Fahrenheit"
}
],
"required": true
}
]
},
"type": "devices.capabilities.temperature_setting"
},
{
"alarmType": null,
"eventState": null,
"instance": "sensorTemperature",
"parameters": null,
"type": "devices.capabilities.property"
},
{
"alarmType": null,
"eventState": null,
"instance": "workMode",
"parameters": {
"dataType": "STRUCT",
"fields": [
{
"dataType": "ENUM",
"defaultValue": null,
"fieldName": "workMode",
"options": [
{
"name": "gearMode",
"value": 1
},
{
"name": "Fan",
"value": 9
},
{
"name": "Auto",
"value": 3
}
],
"required": true
},
{
"dataType": "ENUM",
"defaultValue": null,
"fieldName": "modeValue",
"options": [
{
"name": "gearMode",
"options": [
{
"name": "Low",
"value": 1
},
{
"name": "Medium",
"value": 2
},
{
"name": "High",
"value": 3
}
],
"value": null
},
{
"defaultValue": 0,
"name": "Fan",
"value": null
},
{
"defaultValue": 0,
"name": "Auto",
"value": null
}
],
"required": true
}
]
},
"type": "devices.capabilities.work_mode"
}
],
"device": "REDACTED",
"deviceName": "Smart Space Heater",
"sku": "H7131",
"type": "devices.types.heater"
},
"state": {
"capabilities": [
{
"instance": "online",
"state": {
"value": true
},
"type": "devices.capabilities.online"
},
{
"instance": "powerSwitch",
"state": {
"value": 1
},
"type": "devices.capabilities.on_off"
},
{
"instance": "oscillationToggle",
"state": {
"value": 1
},
"type": "devices.capabilities.toggle"
},
{
"instance": "nightlightToggle",
"state": {
"value": 1
},
"type": "devices.capabilities.toggle"
},
{
"instance": "brightness",
"state": {
"value": 100
},
"type": "devices.capabilities.range"
},
{
"instance": "colorRgb",
"state": {
"value": 16711680
},
"type": "devices.capabilities.color_setting"
},
{
"instance": "nightlightScene",
"state": {
"value": ""
},
"type": "devices.capabilities.mode"
},
{
"instance": "targetTemperature",
"state": {
"value": {
"targetTemperature": 21,
"unit": "Celsius"
}
},
"type": "devices.capabilities.temperature_setting"
},
{
"instance": "sensorTemperature",
"state": {
"value": 72
},
"type": "devices.capabilities.property"
},
{
"instance": "workMode",
"state": {
"value": {
"modeValue": 0,
"workMode": 3
}
},
"type": "devices.capabilities.work_mode"
}
],
"device": "F4:D2:D4:AD:FC:F1:96:70",
"sku": "H7131"
}
}
Thanks! It appears as though there are no units defined for sensorTemperature. If you change your preference for units in the app to celsius, does the sensorTemperature
reading also switch units, or does it remain in F?
Thanks! It appears as though there are no units defined for sensorTemperature. If you change your preference for units in the app to celsius, does the
sensorTemperature
reading also switch units, or does it remain in F?
Weird - it stays °F even if I change units in the Govee app to °C.
The relevant JSON:
{
"instance": "targetTemperature",
"state": {
"value": {
"targetTemperature": 21,
"unit": "Celsius"
}
},
"type": "devices.capabilities.temperature_setting"
},
{
"instance": "sensorTemperature",
"state": {
"value": 68
}
Notable is that no matter how the app is set, targetTemperature always comes through the API in celsius.
FWIW, the errors about listing scenes should no longer show up in the latest version of the addon. The other more important stuff mentioned here is not yet resolved.
The latest version of the addon has some logic that may resolve the temperature readings. Please let me know how you get on with it!
The sensor temp now displays the correct temp aligned with the correct Celsius label in HA. There are still two issues though: 1) My app is set to °F, so I would expect HA to display that, not °C. 2) Minor, but the entity has a display precision of something like 10 decimal points. I can adjust this in HA, but usually temps default display with a max precision of 2 decimal points.
My understanding was the HA will auto-translate temperature units for entities, but it seems like that is not true. I need to figure out if there is a way to make it do that, otherwise, there will need to be a way to configure your choice of units in govee2mqtt and I'll need to translate them on this side. I'm hoping to avoid that, as it feels complex both for users and for the code internals.
re: precision, hmm, I hadn't considered it, but yes it makes sense
The strange thing is that the value being returned in sensorTemperature is in °F but no unit is listed. The targetTemperature is always returned in °C but does at least list the unit. It feels like there's something not right in the API.
Thanks for your efforts either way. This is a great project since Govee seems to have a bunch of neat products that don't work with the core HA integration. Before your add-on I had to set up the heater in Homebridge since there is a (partially) working integration, and then use HomeKit to get it in to HA. Pretty clunky but your approach is much better.
It feels like there's something not right in the API.
There's a LOT that isn't right in the API! It's horrendously inconsistent, but still better than what was available before.
I'm tracking the remaining portion of this in:
{{ (states('sensor.chauffage_bureau_alex_temperature') | float -32 ) * 5/9}}
Create a template with this it should create a new sensor in C even if the data is in F. You should be able to do that the other way around too.
Govee Device SKU
H7131
Govee2MQTT Version
2024.01.11-9564506d
Describe the issue
After installing and configuring the add-on, there a number of issues, but this one is just that the numerical value of the temp from the heater's sensor is degrees F, while the display in HA is reporting it as degrees C.
Startup Diagnostics
Additional Logs
No response
Home Assistant Logs
No response
Anything else?
No response