Closed shing6326 closed 6 months ago
this is the attributes of my fan
preset_modes:
oscillating: false
percentage: 25
percentage_step: 25
preset_mode:
friendly_name: Lemo FW2 1c21ab
supported_features: 3
On the device's page under Settings > Devices & Services > ESPHome, there's a sensor named "Detailed Entity". What do you see on that sensor when the fan page is open with the entity where you want to control the oscillating?
Also, could you please, with that page open, go to Developer Tools, select the tab "Template" and paste the following, then let me know the results when the page fan is open with that same entity?
{% set entity_id = states("sensor.sg_panel_detailed_entity") %}
entity_id: {{ entity_id }}
oscillating: {{ state_attr(entity_id, "oscillating") }} / {{ state_attr(entity_id, "oscillating") | default("true") }}
new oscillating: {{ not (state_attr(entity_id, "oscillating") | default("true")) }}
hello @edwardtfn , thanks for helping, here is the result
SG Panel Detailed Entity:
fan.lemo_fw2_1c21ab_lemo_fw2_1c21ab
Template, when the oscillating is off
entity_id: fan.lemo_fw2_1c21ab_lemo_fw2_1c21ab
oscillating: False / False
new oscillating: True
when the oscillating is on
entity_id: fan.lemo_fw2_1c21ab_lemo_fw2_1c21ab
oscillating: True / True
new oscillating: False
actually the oscillating icon from fan page displays correctly with the state, just no response when clicking it.
I couldn't find the error, but have changed a bit that service call and just pushed a new code to dev
.
Could you please update you blueprint and let me know if you still have that same issue (including that error on HA logs)?
No need to update ESPHome or TFT, only the blueprint was changed for now, and it's version number haven't changed.
hi @edwardtfn, thanks for the help. I have tried the latest blueprint, and the error persists.
Logger: homeassistant.components.automation.sg_nspanel
Source: components/automation/__init__.py:687
integration: Automation ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 9:48:09 PM (15 occurrences)
Last logged: 9:48:18 PM
Error while executing automation automation.sg_nspanel: required key not provided @ data['oscillating']
Logger: homeassistant.components.automation.sg_nspanel
Source: helpers/script.py:1805
integration: Automation ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 9:48:09 PM (60 occurrences)
Last logged: 9:48:18 PM
SG Panel: Main choices: NSPanel event: Choose at step 2: NSPanel service call: If at step 1: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data['oscillating']
SG Panel: Main choices: NSPanel event: Choose at step 2: NSPanel service call: Error executing script. Invalid data for if at pos 1: required key not provided @ data['oscillating']
SG Panel: Main choices: NSPanel event: Error executing script. Invalid data for choose at pos 2: required key not provided @ data['oscillating']
SG Panel: Error executing script. Invalid data for choose at pos 2: required key not provided @ data['oscillating']
Logs from ESPHome when I entered to the fan page and press the oscillating button twice
[22:00:41][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "buttonpage01", "event": "long_click", "component": "button03"}"
[22:00:41][D][text_sensor:064]: 'Detailed Entity': Sending state 'fan.lemo_fw2_1c21ab_lemo_fw2_1c21ab'
[22:00:41][D][nextion:464]: Got new page: 22
[22:00:41][D][text_sensor:064]: 'Current Page': Sending state 'fan'
[22:00:41][D][script.page_changed:2129]: New page: fan
[22:00:41][D][script.page_changed:2131]: Entity shown: fan.lemo_fw2_1c21ab_lemo_fw2_1c21ab
[22:00:41][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[22:00:41][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[22:00:41][D][sensor:094]: 'Page Id': Sending state 22.00000 with 0 decimals of accuracy
[22:00:43][D][nextion:446]: Got touch event:
[22:00:43][D][nextion:447]: page_id: 22
[22:00:43][D][nextion:448]: component_id: 17
[22:00:43][D][nextion:449]: event type: PRESS
[22:00:43][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[22:00:43][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[22:00:43][D][nextion:446]: Got touch event:
[22:00:43][D][nextion:447]: page_id: 22
[22:00:43][D][nextion:448]: component_id: 17
[22:00:43][D][nextion:449]: event type: RELEASE
[22:00:43][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[22:00:43][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[22:00:43][D][sensor:094]: 'Display Current brightness': Sending state 100.00000 % with 0 decimals of accuracy
[22:00:44][D][nextion:446]: Got touch event:
[22:00:44][D][nextion:447]: page_id: 22
[22:00:44][D][nextion:448]: component_id: 17
[22:00:44][D][nextion:449]: event type: PRESS
[22:00:44][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[22:00:44][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[22:00:44][D][nextion:446]: Got touch event:
[22:00:44][D][nextion:447]: page_id: 22
[22:00:44][D][nextion:448]: component_id: 17
[22:00:44][D][nextion:449]: event type: RELEASE
[22:00:44][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[22:00:44][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
I tried to add some logs output but didn't get any messages.
diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml
index 30a0eab..7017ec2 100644
--- a/nspanel_blueprint.yaml
+++ b/nspanel_blueprint.yaml
@@ -7722,6 +7722,10 @@ action:
conditions:
- '{{ nspanel_event.service == "fan.oscillate" }}'
sequence:
+ - service: system_log.write
+ data:
+ message: "Fan oscillate automation triggered. Entity: {{ nspanel_event.entity }}, Service: {{ nspanel_event.service }}"
+ level: warning
- variables:
oscillating: '{{ state_attr(nspanel_event.entity, "oscillating") | default(true) }}'
- service: fan.oscillate```
Could you please try again with v4.3.0b2?
I could finally duplicate the issue and I can see it persists with b2. Will work in a fix.
yes the issue still persists in b2
Thanks @edwardtfn , the commit fixes the issue, much appreciated.
TFT Version
4.3dev4
ESPHome Version
4.3dev4
Blueprint Version
4.3dev4
Panel Model
EU
What is the bug?
fan oscillate button not working
Steps to Reproduce
I suspect the error may comes from esphome/nspanel_esphome_core.yaml line 880, the detailed_entity->state.c_str() returns the panel id instead of my fan's entity id. I tried to troubleshoot it but seems I do not have enough skills to fix it :).
Your Panel's YAML
ESPHome Logs
no logs during the key press
Home Assistant Logs