Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H70B1: #302

Open
XaF opened this issue Nov 2, 2024 · 0 comments
Open

H70B1: #302

XaF opened this issue Nov 2, 2024 · 0 comments

Comments

@XaF
Copy link

XaF commented Nov 2, 2024

Govee Device SKU

H70B1

Govee2MQTT Version

2024.07.21-c9d27764

Describe the issue

Scenes for extended curtain lights are not available.
I have two curtain lights setup in extended mode in Govee, giving me access to more scenes, including special scenes spanning more than one curtain, and slight changes in existing scenes that will span the two curtains (instead of just cloning the same scene on both curtains).
When using govee2mqtt, those scenes are not available. Only the "for 1 curtain" scenes are, and get duplicated on both curtains.

e.g. error:

govee2mqtt  | [2024-11-02T18:38:09 INFO  govee::service::hass] Command for Smart Curtain Lights (xx:xx:xx:xx:xx:xx:xx:xx H70B1): {"state":"ON","effect":"Bonfire"}
govee2mqtt  | [2024-11-02T18:38:09 INFO  govee::service::state] Using Platform API to set Smart Curtain Lights (xx:xx:xx:xx:xx:xx:xx:xx H70B1) to scene Bonfire
govee2mqtt  | [2024-11-02T18:38:09 ERROR govee::service::hass] While dispatching Message { topic: "gv2mqtt/light/xxxxxxxxxxxxxxxx/command", payload: "{\"state\":\"ON\",\"effect\":\"Bonfire\"}", qos: AtMostOnce, retain: false, mid: 0 }: mqtt_light_command: state.device_set_scene: Scene 'Bonfire' is not available for this device
govee2mqtt  | [2024-11-02T18:38:09 INFO  govee::service::hass] Command for Smart Curtain Lights R (xx:xx:xx:xx:xx:xx:xx:xx H70B1): {"state":"ON","effect":"Bonfire"}
govee2mqtt  | [2024-11-02T18:38:09 INFO  govee::service::state] Using Platform API to set Smart Curtain Lights R (xx:xx:xx:xx:xx:xx:xx:xx H70B1) to scene Bonfire
govee2mqtt  | [2024-11-02T18:38:09 ERROR govee::service::hass] While dispatching Message { topic: "gv2mqtt/light/xxxxxxxxxxxxxxxx/command", payload: "{\"state\":\"ON\",\"effect\":\"Bonfire\"}", qos: AtMostOnce, retain: false, mid: 0 }: mqtt_light_command: state.device_set_scene: Scene 'Bonfire' is not available for this device

The error raised comes from:

pub async fn set_scene_by_name(
&self,
device: &HttpDeviceInfo,
scene: &str,
) -> anyhow::Result<ControlDeviceResponseCapability> {
if scene == "" {
// Can't set no scene
anyhow::bail!("Cannot set scene to no-scene");
}
if let Some(music_mode) = scene.strip_prefix("Music: ") {
if let Some(cap) = device.capability_by_instance("musicMode") {
if let Some(field) = cap.struct_field_by_name("musicMode") {
if let Some(value) = field.field_type.enum_parameter_by_name(music_mode) {
let value = serde_json::json!({
"musicMode": value,
"sensitivity": 100,
"autoColor": 1,
});
return self.control_device(&device, &cap, value).await;
}
}
}
}
let caps = self.get_scene_caps(device).await?;
for cap in caps {
match &cap.parameters {
Some(DeviceParameters::Enum { options }) => {
for opt in options {
if scene.eq_ignore_ascii_case(&opt.name) {
return self.control_device(&device, &cap, opt.value.clone()).await;
}
}
}
_ => anyhow::bail!("set_scene_by_name: unexpected type {cap:#?}"),
}
}
anyhow::bail!("Scene '{scene}' is not available for this device");
}

Which means the scenes when extending might not be loaded in the cache?
I have also tried purging the cache to no avail.

Startup Diagnostics

govee2mqtt  | [2024-11-02T18:30:05 INFO  govee::commands::serve] Starting service. version 2024.07.21-c9d27764
govee2mqtt  | [2024-11-02T18:30:05 INFO  govee::commands::serve] Querying platform API for device list
govee2mqtt  | [2024-11-02T18:30:05 INFO  govee::commands::serve] Querying undocumented API for device + room list
govee2mqtt  | [2024-11-02T18:30:06 INFO  govee::service::iot] Connected to IoT: CONNACK code 0: Connection Accepted.
govee2mqtt  | [2024-11-02T18:30:06 INFO  govee::commands::serve] Starting LAN discovery
govee2mqtt  | [2024-11-02T18:30:06 INFO  govee::commands::serve] Waiting 10 seconds for LAN API discovery
govee2mqtt  | [2024-11-02T18:30:06 INFO  govee::service::iot] IoT (re)connected with status CONNACK code 0: Connection Accepted.
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve] Devices returned from Govee's APIs
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve] Smart Curtain Lights (xx:xx:xx:xx:xx:xx:xx:xx H70B1)
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   LAN API: ip=xxx.xxx.xxx.xxx
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   Platform API: devices.types.light. supports_rgb=true supports_brightness=true
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]                 color_temp=Some((2000, 9000)) segment_rgb=None
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   Undoc: room=None supports_iot=true ble_only=false
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   Quirk { sku: "H70B1", icon: "mdi:light-bulb", supports_rgb: true, supports_brightness: true, color_temp_range: Some((2000, 9000)), avoid_platform_api: false, ble_only: false, lan_api_capable: true, device_type: Light, platform_temperature_sensor_units: None, platform_humidity_sensor_units: None, iot_api_supported: true, show_as_preset_buttons: None }
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve] Smart Curtain Lights R (xx:xx:xx:xx:xx:xx:xx:xx H70B1)
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   LAN API: ip=xxx.xxx.xxx.xxx
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   Platform API: devices.types.light. supports_rgb=true supports_brightness=true
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]                 color_temp=Some((2000, 9000)) segment_rgb=None
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   Undoc: room=None supports_iot=true ble_only=false
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]   Quirk { sku: "H70B1", icon: "mdi:light-bulb", supports_rgb: true, supports_brightness: true, color_temp_range: Some((2000, 9000)), avoid_platform_api: false, ble_only: false, lan_api_capable: true, device_type: Light, platform_temperature_sensor_units: None, platform_humidity_sensor_units: None, iot_api_supported: true, show_as_preset_buttons: None }
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::commands::serve]
govee2mqtt  | [2024-11-02T18:30:16 INFO  govee::service::http] http server addr is 0.0.0.0:8056
govee2mqtt  | [2024-11-02T18:30:37 INFO  govee::service::hass] Wait 100ms for hass to settle on 10 entity configs
govee2mqtt  | [2024-11-02T18:30:37 INFO  govee::service::hass] MQTT connected with status=CONNACK code 0: Connection Accepted.

Additional Logs

No response

Home Assistant Logs

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant