Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.43k stars 259 forks source link

`Bug` LocalTuya Fan speed controls not working with NSPanel #1706

Closed irvintim closed 8 months ago

irvintim commented 9 months ago

TFT Version

4.2.4

ESPHome Version

4.2.4

Blueprint Version

4.2.4

Panel Model

NSPanel US Model

What is the bug?

When I try to adjust the fan speed for a LocalTuya-mangaged fan, the fan speed doesn't change. On/off does work.

Steps to Reproduce

  1. I configured Custom button 01 - ENTITY (Optional) to fan.living_room_fan
  2. I pressed on the fan icon on the NSPanal
  3. The panel switches to the fan control page with a slider to set the fan speed, but changes to the speed don't result in any changes to the fan's speed.

Some other details: if I go to that fan's device page in Home Assistant, I CAN adjust the fan speed with the slider. But when I change the speed setting on the NSPanel, I don't see any updates on this Home Assitant device page.

I have another fan controlled by a different NSPanael, that fax is controlled through Bond, and it's speed settings work fin on the NSPanel.

One thing I notice in the HA logs, when I change the speed settings on each fan, the one that doesn't work logs this: Living Room NSPanel Configuration triggered by event 'esphome.nspanel_ha_blueprint' while the one that does work logs both of these lines: Bedroom NSPanel Configuration triggered by automation Bedroom NSPanel Configuration triggered by event 'esphome.nspanel_ha_blueprint' Bedroom NSPanel Configuration triggered by event 'esphome.nspanel_ha_blueprint'

Your panel's YAML

wifi:
  # ...
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 10.26.10.51
    # Set this to the IP address of the router. Often ends with .1
    gateway: 10.26.10.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0

substitutions:
  ###### CHANGE ME START ######
  device_name: "lr-nspanel"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password

  nextion_update_url: "http://10.26.10.11:8123/local/nspanel_us.tft"
  nextion_blank_url: "http://10.26.10.11:8123/local/nspanel_blank.tft"

  ##### addon-configuration #####
  ## addon_climate ##
  # addon_climate_heater_relay: "1" # possible values: 1/2
  # heater_relay: "0"
  temp_units: "°F" #Temperatures in Fahrenheit
  # temp_min: "0" #Min supported temperature is 40°F
  # temp_max: "80" #Max supported temperature is 80°F
  # temp_step: "1" #Temperature granularity is 1°F

  ##### CHANGE ME END #####

packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      # - advanced/esphome/nspanel_esphome_addon_climate_base.yaml
      # - advanced/esphome/nspanel_esphome_advanced.yaml # activate advanced (legacy) elements - can be useful for troubleshooting
      # - nspanel_esphome_addon_climate_cool.yaml # activate for local climate (cooling) control
      # - nspanel_esphome_addon_climate_heat.yaml # activate for local climate (heater) control
    refresh: 1s

esp32:
  framework:
    type: esp-idf

##### My customization - Start #####
# climate:
#   - id: !extend thermostat_embedded
#     default_preset: "Home"
#     preset:
#       - name: "Off"
#         default_target_temperature_low: ${temp_min} ${temp_units}
#         mode: "off"
#       - name: "Home"
#         default_target_temperature_low: 67 ${temp_units}
#         mode: "heat"
#       - name: "Away"
#         default_target_temperature_low: 55 ${temp_units}
#         mode: "heat"
#       - name: "Sleep"
#         default_target_temperature_low: 64 ${temp_units}
#         mode: "heat"
##### My customization - End #####

ESPHome logs

INFO ESPHome 2023.12.8
INFO Reading configuration /config/lr-nspanel.yaml...
INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@main
INFO Detected timezone 'America/Los_Angeles'
INFO Starting log output from 10.26.10.51 using esphome API
INFO Successfully connected to lr-nspanel @ 10.26.10.51 in 0.026s
INFO Successful handshake with lr-nspanel @ 10.26.10.51 in 0.043s
[19:33:10][I][app:102]: ESPHome version 2023.12.8 compiled on Jan 21 2024, 17:27:32
[19:33:10][C][wifi:573]: WiFi:
[19:33:10][C][wifi:405]:   Local MAC: A0:B7:65:54:9B:5C
[19:33:10][C][wifi:410]:   SSID: 'MillCreek'[redacted]
[19:33:10][C][wifi:411]:   IP Address: 10.26.10.51
[19:33:10][C][wifi:413]:   BSSID: 62:22:32:1A:E4:B5[redacted]
[19:33:10][C][wifi:414]:   Hostname: 'lr-nspanel'
[19:33:10][C][wifi:416]:   Signal strength: -26 dB ▂▄▆█
[19:33:10][C][wifi:420]:   Channel: 11
[19:33:10][C][wifi:421]:   Subnet: 255.255.255.0
[19:33:10][C][wifi:422]:   Gateway: 10.26.10.1
[19:33:10][C][wifi:423]:   DNS1: 0.0.0.0
[19:33:10][C][wifi:424]:   DNS2: 0.0.0.0
[19:33:10][C][logger:439]: Logger:
[19:33:10][C][logger:440]:   Level: DEBUG
[19:33:10][C][logger:441]:   Log Baud Rate: 0
[19:33:10][C][logger:443]:   Hardware UART: UART0
[19:33:10][C][uart.idf:139]: UART Bus 0:
[19:33:10][C][uart.idf:140]:   TX Pin: GPIO16
[19:33:10][C][uart.idf:141]:   RX Pin: GPIO17
[19:33:10][C][uart.idf:143]:   RX Buffer Size: 256
[19:33:10][C][uart.idf:145]:   Baud Rate: 115200 baud
[19:33:10][C][uart.idf:146]:   Data Bits: 8
[19:33:10][C][uart.idf:147]:   Parity: NONE
[19:33:10][C][uart.idf:148]:   Stop bits: 1
[19:33:10][C][ledc.output:164]: LEDC Output:
[19:33:10][C][ledc.output:165]:   Pin GPIO21
[19:33:10][C][ledc.output:166]:   LEDC Channel: 0
[19:33:10][C][ledc.output:167]:   PWM Frequency: 1000.0 Hz
[19:33:10][C][ledc.output:168]:   Bit depth: 16
[19:33:10][C][template.binary_sensor:028]: Template Binary Sensor 'lr-nspanel Nextion display'
[19:33:10][C][template.binary_sensor:028]:   Device Class: 'connectivity'
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Display Brightness'
[19:33:10][C][template.number:050]:   Unit of Measurement: '%'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Display Brightness Dimdown'
[19:33:10][C][template.number:050]:   Unit of Measurement: '%'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Display Brightness Sleep'
[19:33:10][C][template.number:050]:   Unit of Measurement: '%'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Temperature Correction'
[19:33:10][C][template.number:050]:   Unit of Measurement: '°F'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Timeout Page'
[19:33:10][C][template.number:050]:   Icon: 'mdi:timer'
[19:33:10][C][template.number:050]:   Unit of Measurement: 's'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Timeout Dimming'
[19:33:10][C][template.number:050]:   Icon: 'mdi:timer'
[19:33:10][C][template.number:050]:   Unit of Measurement: 's'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.number:050]: Template Number 'lr-nspanel Timeout Sleep'
[19:33:10][C][template.number:050]:   Icon: 'mdi:timer'
[19:33:10][C][template.number:050]:   Unit of Measurement: 's'
[19:33:10][C][template.number:051]:   Optimistic: YES
[19:33:10][C][template.number:052]:   Update Interval: 60.0s
[19:33:10][C][template.select:065]: Template Select 'lr-nspanel Baud rate'
[19:33:10][C][template.select:065]:   Icon: 'mdi:swap-horizontal'
[19:33:10][C][template.select:066]:   Update Interval: 60.0s
[19:33:10][C][template.select:069]:   Optimistic: YES
[19:33:10][C][template.select:070]:   Initial Option: 115200
[19:33:10][C][template.select:071]:   Restore Value: YES
[19:33:10][C][template.select:065]: Template Select 'lr-nspanel Wake-up page'
[19:33:10][C][template.select:065]:   Icon: 'mdi:page-next-outline'
[19:33:10][C][template.select:066]:   Update Interval: 60.0s
[19:33:10][C][template.select:069]:   Optimistic: YES
[19:33:10][C][template.select:070]:   Initial Option: home
[19:33:10][C][template.select:071]:   Restore Value: YES
[19:33:11][C][template.select:065]: Template Select 'lr-nspanel Update TFT display - Branch'
[19:33:11][C][template.select:065]:   Icon: 'mdi:file-sync'
[19:33:11][C][template.select:066]:   Update Interval: 60.0s
[19:33:11][C][template.select:069]:   Optimistic: YES
[19:33:11][C][template.select:070]:   Initial Option: main
[19:33:11][C][template.select:071]:   Restore Value: YES
[19:33:11][C][template.select:065]: Template Select 'lr-nspanel Update TFT display - Model'
[19:33:11][C][template.select:065]:   Icon: 'mdi:file-sync'
[19:33:11][C][template.select:066]:   Update Interval: 60.0s
[19:33:11][C][template.select:069]:   Optimistic: YES
[19:33:11][C][template.select:070]:   Initial Option: Use nextion_update_url
[19:33:11][C][template.select:071]:   Restore Value: YES
[19:33:11][C][template.text_sensor:020]: Template Sensor 'lr-nspanel Detailed Entity'
[19:33:11][C][template.text_sensor:020]:   Icon: 'mdi:tablet-dashboard'
[19:33:11][C][template.text_sensor:020]: Template Sensor 'lr-nspanel Current page'
[19:33:11][C][template.text_sensor:020]:   Icon: 'mdi:tablet-dashboard'
[19:33:11][C][template.text_sensor:020]: Template Sensor 'lr-nspanel Notification Label'
[19:33:11][C][template.text_sensor:020]: Template Sensor 'lr-nspanel Notification Text'
[19:33:11][C][switch.gpio:068]: GPIO Switch 'lr-nspanel Relay 1'
[19:33:11][C][switch.gpio:091]:   Restore Mode: restore defaults to OFF
[19:33:11][C][switch.gpio:031]:   Pin: GPIO22
[19:33:11][C][switch.gpio:068]: GPIO Switch 'lr-nspanel Relay 2'
[19:33:11][C][switch.gpio:091]:   Restore Mode: restore defaults to OFF
[19:33:11][C][switch.gpio:031]:   Pin: GPIO19
[19:33:11][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'lr-nspanel Left Button'
[19:33:11][C][gpio.binary_sensor:016]:   Pin: GPIO14
[19:33:11][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'lr-nspanel Right Button'
[19:33:11][C][gpio.binary_sensor:016]:   Pin: GPIO27
[19:33:11][C][switch.gpio:068]: GPIO Switch 'lr-nspanel Nextion display - Power'
[19:33:11][C][switch.gpio:091]:   Restore Mode: always ON
[19:33:11][C][switch.gpio:031]:   Pin: GPIO4
[19:33:12][C][template.switch:068]: Template Switch 'lr-nspanel Notification sound'
[19:33:12][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[19:33:12][C][template.switch:057]:   Optimistic: YES
[19:33:12][C][template.switch:068]: Template Switch 'lr-nspanel Relay 1 Local'
[19:33:12][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[19:33:12][C][template.switch:057]:   Optimistic: YES
[19:33:12][C][template.switch:068]: Template Switch 'lr-nspanel Relay 2 Local'
[19:33:12][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[19:33:12][C][template.switch:057]:   Optimistic: YES
[19:33:12][C][template.switch:068]: Template Switch 'lr-nspanel Notification unread'
[19:33:12][C][template.switch:091]:   Restore Mode: always OFF
[19:33:12][C][template.switch:057]:   Optimistic: YES
[19:33:12][C][rtttl:029]: Rtttl
[19:33:12][C][nextion:128]: Nextion:
[19:33:12][C][nextion:129]:   Device Model:     NX4832F035_011C
[19:33:12][C][nextion:130]:   Firmware Version: 72
[19:33:12][C][nextion:131]:   Serial Number:    6AB13401B605F35C
[19:33:12][C][nextion:132]:   Flash Size:       16777216
[19:33:12][C][nextion:133]:   Wake On Touch:    YES
[19:33:12][C][nextion:134]:   Exit reparse:     YES
[19:33:12][C][restart.button:017]: Restart Button 'lr-nspanel Restart'
[19:33:12][C][adc:097]: ADC Sensor 'ntc_source'
[19:33:12][C][adc:097]:   Device Class: 'voltage'
[19:33:12][C][adc:097]:   State Class: 'measurement'
[19:33:12][C][adc:097]:   Unit of Measurement: 'V'
[19:33:12][C][adc:097]:   Accuracy Decimals: 2
[19:33:12][C][adc:107]:   Pin: GPIO38
[19:33:12][C][adc:122]:  Attenuation: 11db
[19:33:12][C][adc:142]:   Update Interval: 60.0s
[19:33:12][C][resistance:010]: Resistance Sensor 'resistance_sensor'
[19:33:12][C][resistance:010]:   State Class: 'measurement'
[19:33:12][C][resistance:010]:   Unit of Measurement: 'Ω'
[19:33:12][C][resistance:010]:   Accuracy Decimals: 1
[19:33:12][C][resistance:010]:   Icon: 'mdi:flash'
[19:33:12][C][resistance:011]:   Configuration: DOWNSTREAM
[19:33:12][C][resistance:012]:   Resistor: 11200.00Ω
[19:33:12][C][resistance:013]:   Reference Voltage: 3.3V
[19:33:12][C][ntc:014]: NTC Sensor 'lr-nspanel Temperature'
[19:33:12][C][ntc:014]:   Device Class: 'temperature'
[19:33:12][C][ntc:014]:   State Class: 'measurement'
[19:33:12][C][ntc:014]:   Unit of Measurement: '°F'
[19:33:12][C][ntc:014]:   Accuracy Decimals: 1
[19:33:12][C][homeassistant.time:010]: Home Assistant Time:
[19:33:12][C][homeassistant.time:011]:   Timezone: 'PST8PDT,M3.2.0,M11.1.0'
[19:33:12][C][status:034]: Status Binary Sensor 'lr-nspanel Status'
[19:33:12][C][status:034]:   Device Class: 'connectivity'
[19:33:13][C][mdns:115]: mDNS:
[19:33:13][C][mdns:116]:   Hostname: lr-nspanel
[19:33:13][C][ota:097]: Over-The-Air Updates:
[19:33:13][C][ota:098]:   Address: 10.26.10.51:3232
[19:33:13][C][ota:101]:   Using Password.
[19:33:13][C][api:139]: API Server:
[19:33:13][C][api:140]:   Address: 10.26.10.51:6053
[19:33:13][C][api:144]:   Using noise encryption: NO
[19:33:13][C][wifi_signal.sensor:009]: WiFi Signal 'lr-nspanel RSSI'
[19:33:13][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[19:33:13][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[19:33:13][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[19:33:13][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[19:33:22][D][time:045]: Synchronized time: 2024-01-21 19:33:22
[19:33:22][D][main:118]: System clock synchronized
[19:33:22][D][time:045]: Synchronized time: 2024-01-21 19:33:22
[19:33:22][D][main:118]: System clock synchronized
[19:33:23][D][sensor:094]: 'ntc_source': Sending state 1.71300 V with 2 decimals of accuracy
[19:33:23][D][resistance:039]: 'resistance_sensor' - Resistance 12089.2Ω
[19:33:23][D][sensor:094]: 'resistance_sensor': Sending state 12089.22559 Ω with 1 decimals of accuracy
[19:33:23][D][ntc:026]: 'lr-nspanel Temperature' - Temperature: 20.8°C
[19:33:23][D][sensor:094]: 'lr-nspanel Temperature': Sending state 69.42287 °F with 1 decimals of accuracy
[19:33:25][I][addon_upload_tft.script.report_settings:189]: TFT URL: http://10.26.10.11:8123/local/nspanel_us.tft
[19:33:25][I][addon_upload_tft.script.report_settings:190]: Substitutions:
[19:33:25][I][addon_upload_tft.script.report_settings:191]:   nextion_update_url:        http://10.26.10.11:8123/local/nspanel_us.tft
[19:33:25][I][addon_upload_tft.script.report_settings:192]:   nextion_update_base_url:   https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/
[19:33:25][I][addon_upload_tft.script.report_settings:193]:   upload_tft_chunk_size_max: 32768
[19:33:25][I][addon_upload_tft.script.report_settings:194]:   upload_tft_baud_rate:      921600
[19:33:30][I][script.watchdog:3115]: Wi-Fi:         Excellent (-23 dBm)
[19:33:30][I][script.watchdog:3135]: API:           Connected
[19:33:30][I][script.watchdog:3153]: Blueprint:     4.2.4
[19:33:30][I][script.watchdog:3166]: ESPHome:
[19:33:30][I][script.watchdog:3167]:   Version:     4.2.4
[19:33:30][I][script.watchdog:3172]:   Framework:   esp-idf
[19:33:30][I][script.watchdog:3176]: UART:
[19:33:30][I][script.watchdog:3177]:   Baud rate:   115200 bps
[19:33:30][I][script.watchdog:3178]:   Queue size:  12
[19:33:30][I][script.watchdog:3182]: Nextion:
[19:33:30][I][script.watchdog:3183]:   Queue size:  3
[19:33:30][I][script.watchdog:3185]:   Is setup:    True
[19:33:30][I][script.watchdog:3192]:   Init:        True
[19:33:30][I][script.watchdog:3200]:   TFT:         4.2.4
[19:33:41][D][sensor:094]: 'lr-nspanel RSSI': Sending state -25.00000 dBm with 0 decimals of accuracy
[19:33:45][D][nextion:446]: Got touch event:
[19:33:45][D][nextion:447]:   page_id:      9
[19:33:45][D][nextion:448]:   component_id: 4
[19:33:45][D][nextion:449]:   event type:   PRESS
[19:33:45][D][nextion:446]: Got touch event:
[19:33:45][D][nextion:447]:   page_id:      9
[19:33:45][D][nextion:448]:   component_id: 4
[19:33:45][D][nextion:449]:   event type:   RELEASE
[19:33:45][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:45][D][nextion:464]: Got new page: 0
[19:33:45][D][display.disp1.on_page:716]: Nextion page changed
[19:33:45][D][display.disp1.on_page:717]: New page: home (0)
[19:33:45][D][text_sensor:064]: 'lr-nspanel Current page': Sending state 'home'
[19:33:45][D][text_sensor:064]: 'lr-nspanel Detailed Entity': Sending state ''
[19:33:45][D][script.page_changed:2110]: New page: home
[19:33:45][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:45][D][script.timer_dim:2934]: Waking up on page: home
[19:33:45][D][script.set_brightness:2504]: brightness: 57%
[19:33:45][D][sensor:094]: 'lr-nspanel Page Id': Sending state 0.00000  with 0 decimals of accuracy
[19:33:45][D][sensor.page_id:1381]: New page Id: 0
[19:33:45][D][sensor:094]: 'lr-nspanel Display Current brightness': Sending state 2.00000 % with 0 decimals of accuracy
[19:33:45][D][sensor.current_brightness:1366]: Current brightness: 2%
[19:33:50][D][sensor:094]: 'lr-nspanel Display Current brightness': Sending state 57.00000 % with 0 decimals of accuracy
[19:33:50][D][sensor.current_brightness:1366]: Current brightness: 57%
[19:33:50][D][nextion:446]: Got touch event:
[19:33:50][D][nextion:447]:   page_id:      0
[19:33:50][D][nextion:448]:   component_id: 0
[19:33:50][D][nextion:449]:   event type:   PRESS
[19:33:50][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:50][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:50][D][nextion:446]: Got touch event:
[19:33:50][D][nextion:447]:   page_id:      0
[19:33:50][D][nextion:448]:   component_id: 0
[19:33:50][D][nextion:449]:   event type:   RELEASE
[19:33:50][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:50][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:54][D][nextion:446]: Got touch event:
[19:33:54][D][nextion:447]:   page_id:      0
[19:33:54][D][nextion:448]:   component_id: 0
[19:33:54][D][nextion:449]:   event type:   PRESS
[19:33:54][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:54][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:55][D][nextion:446]: Got touch event:
[19:33:55][D][nextion:447]:   page_id:      0
[19:33:55][D][nextion:448]:   component_id: 0
[19:33:55][D][nextion:449]:   event type:   RELEASE
[19:33:55][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:55][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:56][D][nextion:446]: Got touch event:
[19:33:56][D][nextion:447]:   page_id:      0
[19:33:56][D][nextion:448]:   component_id: 38
[19:33:56][D][nextion:449]:   event type:   PRESS
[19:33:56][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:56][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:57][D][nextion:446]: Got touch event:
[19:33:57][D][nextion:447]:   page_id:      0
[19:33:57][D][nextion:448]:   component_id: 38
[19:33:57][D][nextion:449]:   event type:   RELEASE
[19:33:57][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:57][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:57][D][text_sensor:064]: 'lr-nspanel NSPanel local event': Sending state '{"page": "home", "event": "short_click", "component": "button01"}'
[19:33:57][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:57][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:57][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "home", "event": "short_click", "component": "button01"}"
[19:33:57][D][text_sensor:064]: 'lr-nspanel Detailed Entity': Sending state 'fan.living_room_fan'
[19:33:57][D][nextion:464]: Got new page: 22
[19:33:57][D][display.disp1.on_page:716]: Nextion page changed
[19:33:57][D][display.disp1.on_page:717]: New page: fan (22)
[19:33:57][D][text_sensor:064]: 'lr-nspanel Current page': Sending state 'fan'
[19:33:57][D][script.page_changed:2110]: New page: fan
[19:33:57][D][script.page_changed:2111]: Entity shown: fan.living_room_fan
[19:33:57][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:33:57][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:33:57][D][sensor:094]: 'lr-nspanel Page Id': Sending state 22.00000  with 0 decimals of accuracy
[19:33:57][D][sensor.page_id:1381]: New page Id: 22
[19:34:00][D][nextion:446]: Got touch event:
[19:34:00][D][nextion:447]:   page_id:      22
[19:34:00][D][nextion:448]:   component_id: 9
[19:34:00][D][nextion:449]:   event type:   PRESS
[19:34:00][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:00][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:00][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:00][D][nextion:446]: Got touch event:
[19:34:00][D][nextion:447]:   page_id:      22
[19:34:00][D][nextion:448]:   component_id: 9
[19:34:00][D][nextion:449]:   event type:   RELEASE
[19:34:00][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:00][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:00][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:01][D][text_sensor:064]: 'lr-nspanel NSPanel local event': Sending state '{"page": "fan", "key": "percentage", "value": 25}'
[19:34:01][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "fan", "key": "percentage", "value": 25}"
[19:34:05][D][nextion:446]: Got touch event:
[19:34:05][D][nextion:447]:   page_id:      22
[19:34:05][D][nextion:448]:   component_id: 3
[19:34:05][D][nextion:449]:   event type:   PRESS
[19:34:05][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:05][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:05][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:06][D][nextion:446]: Got touch event:
[19:34:06][D][nextion:447]:   page_id:      22
[19:34:06][D][nextion:448]:   component_id: 3
[19:34:06][D][nextion:449]:   event type:   RELEASE
[19:34:06][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:06][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:06][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:07][D][text_sensor:064]: 'lr-nspanel NSPanel local event': Sending state '{"page": "fan", "key": "percentage", "value": 75}'
[19:34:07][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "fan", "key": "percentage", "value": 75}"
[19:34:12][D][nextion:446]: Got touch event:
[19:34:12][D][nextion:447]:   page_id:      22
[19:34:12][D][nextion:448]:   component_id: 3
[19:34:12][D][nextion:449]:   event type:   PRESS
[19:34:12][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:12][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:12][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:14][D][nextion:446]: Got touch event:
[19:34:14][D][nextion:447]:   page_id:      22
[19:34:14][D][nextion:448]:   component_id: 3
[19:34:14][D][nextion:449]:   event type:   RELEASE
[19:34:14][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:14][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:14][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:15][D][text_sensor:064]: 'lr-nspanel NSPanel local event': Sending state '{"page": "fan", "key": "percentage", "value": 50}'
[19:34:15][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "fan", "key": "percentage", "value": 50}"
[19:34:17][D][nextion:446]: Got touch event:
[19:34:17][D][nextion:447]:   page_id:      22
[19:34:17][D][nextion:448]:   component_id: 3
[19:34:17][D][nextion:449]:   event type:   PRESS
[19:34:17][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:17][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:17][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:17][D][nextion:446]: Got touch event:
[19:34:17][D][nextion:447]:   page_id:      22
[19:34:17][D][nextion:448]:   component_id: 3
[19:34:17][D][nextion:449]:   event type:   RELEASE
[19:34:17][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:17][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:17][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:18][D][text_sensor:064]: 'lr-nspanel NSPanel local event': Sending state '{"page": "fan", "key": "percentage", "value": 25}'
[19:34:18][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "fan", "key": "percentage", "value": 25}"
[19:34:23][D][sensor:094]: 'ntc_source': Sending state 1.71500 V with 2 decimals of accuracy
[19:34:23][D][resistance:039]: 'resistance_sensor' - Resistance 12118.6Ω
[19:34:23][D][sensor:094]: 'resistance_sensor': Sending state 12118.61230 Ω with 1 decimals of accuracy
[19:34:23][D][ntc:026]: 'lr-nspanel Temperature' - Temperature: 20.7°C
[19:34:23][D][sensor:094]: 'lr-nspanel Temperature': Sending state 69.32729 °F with 1 decimals of accuracy
[19:34:27][D][nextion:446]: Got touch event:
[19:34:27][D][nextion:447]:   page_id:      22
[19:34:27][D][nextion:448]:   component_id: 12
[19:34:27][D][nextion:449]:   event type:   PRESS
[19:34:27][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:27][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:27][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:27][D][text_sensor:064]: 'lr-nspanel NSPanel local event': Sending state '{"page": "fan", "key": "stop", "value": 0}'
[19:34:27][D][nextion_textsensor:014]: Processed text_sensor "localevent" state "{"page": "fan", "key": "stop", "value": 0}"
[19:34:27][D][nextion:446]: Got touch event:
[19:34:27][D][nextion:447]:   page_id:      22
[19:34:27][D][nextion:448]:   component_id: 12
[19:34:27][D][nextion:449]:   event type:   RELEASE
[19:34:27][D][script:077]: Script 'timer_page' restarting (mode: restart)
[19:34:27][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[19:34:27][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[19:34:30][I][script.watchdog:3115]: Wi-Fi:         Excellent (-25 dBm)
[19:34:30][I][script.watchdog:3135]: API:           Connected
[19:34:30][I][script.watchdog:3153]: Blueprint:     4.2.4
[19:34:30][I][script.watchdog:3166]: ESPHome:
[19:34:30][I][script.watchdog:3167]:   Version:     4.2.4
[19:34:30][I][script.watchdog:3172]:   Framework:   esp-idf
[19:34:30][I][script.watchdog:3176]: UART:
[19:34:30][I][script.watchdog:3177]:   Baud rate:   115200 bps
[19:34:30][I][script.watchdog:3178]:   Queue size:  12
[19:34:30][I][script.watchdog:3182]: Nextion:
[19:34:30][I][script.watchdog:3183]:   Queue size:  3
[19:34:30][I][script.watchdog:3185]:   Is setup:    True
[19:34:30][I][script.watchdog:3192]:   Init:        True
[19:34:30][I][script.watchdog:3200]:   TFT:         4.2.4

Home Assistant logs

Logs are to big to paste, this link will download them:
https://send.bitwarden.com/#ik0pj4sxEkC8fLD_AD0jCA/GYhyXLrcUv73b1hN-1F_2A
edwardtfn commented 9 months ago

Could you please go to Developer Tools, select tab "States" and find this fan entity there, then please share here it's state and attributes?

irvintim commented 9 months ago

fan.living_room_fan Living Room Fan

State: off

Attributes: preset_modes: null percentage: 25 percentage_step: 25 preset_mode: null friendly_name: Living Room Fan supported_features: 1

edwardtfn commented 8 months ago

I'm trying to duplicate this with no success. Are you still having this issue? If so, could you please take a look at Home Assistant logs (Settings > System > Logs) for any message that could be related to this?

irvintim commented 8 months ago

I can do that this weekend. This is at a remote location.

On Wed, Jan 31, 2024, 6:47 AM Edward Firmo @.***> wrote:

I'm trying to duplicate this with no success. Are you still having this issue? If so, could you please take a look at Home Assistant logs (Settings > System > Logs) for any message that could be related to this?

— Reply to this email directly, view it on GitHub https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1706#issuecomment-1919253594, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLU4VR22TVAWJAD36NSHOLYRJKPNAVCNFSM6AAAAABCEQYCQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJZGI2TGNJZGQ . You are receiving this because you authored the thread.Message ID: @.***>

irvintim commented 8 months ago

I turned on Local Tuya debug logs and then at the NSPanel tried to adjust the fan speed, these were the logs I was getting. The fan stayed at the lowest setting, even when I clicked 50%, 75% or 100% on teh NSPanel:

2024-02-03 14:16:52.623 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_on
2024-02-03 14:16:52.701 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:16:53.214 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:16:55.126 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_on
2024-02-03 14:16:55.158 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:16:55.670 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:07.548 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_on
2024-02-03 14:17:07.648 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:08.160 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:09.954 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_on
2024-02-03 14:17:09.997 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:10.511 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:18.348 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_on
2024-02-03 14:17:18.396 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:18.908 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:19.453 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_on
2024-02-03 14:17:19.528 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:17:20.040 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4

I then brought up the Lovelace fan controller in the web interface and did the same adjustments and these logs were created:

2024-02-03 14:18:02.870 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 50
2024-02-03 14:18:03.013 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 50 > 2.0
2024-02-03 14:18:03.015 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:03.104 DEBUG (SyncWorker_5) [custom_components.localtuya.fan] Fan current_speed ranged_value_to_percentage: 2 from (1, 4)
2024-02-03 14:18:03.104 DEBUG (SyncWorker_5) [custom_components.localtuya.fan] Fan current_percentage: 50
2024-02-03 14:18:03.105 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:05.787 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 75
2024-02-03 14:18:05.872 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 75 > 3.0
2024-02-03 14:18:05.873 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:05.969 DEBUG (SyncWorker_8) [custom_components.localtuya.fan] Fan current_speed ranged_value_to_percentage: 3 from (1, 4)
2024-02-03 14:18:05.969 DEBUG (SyncWorker_8) [custom_components.localtuya.fan] Fan current_percentage: 75
2024-02-03 14:18:05.970 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:07.167 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 100
2024-02-03 14:18:07.209 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 100 > 4.0
2024-02-03 14:18:07.210 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:07.299 DEBUG (SyncWorker_3) [custom_components.localtuya.fan] Fan current_speed ranged_value_to_percentage: 4 from (1, 4)
2024-02-03 14:18:07.299 DEBUG (SyncWorker_3) [custom_components.localtuya.fan] Fan current_percentage: 100
2024-02-03 14:18:07.301 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:10.364 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_turn_off
2024-02-03 14:18:10.478 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4
2024-02-03 14:18:10.573 DEBUG (SyncWorker_8) [custom_components.localtuya.fan] Fan current_speed ranged_value_to_percentage: 4 from (1, 4)
2024-02-03 14:18:10.573 DEBUG (SyncWorker_8) [custom_components.localtuya.fan] Fan current_percentage: 100
2024-02-03 14:18:10.575 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 4

These were in /config/home-assistant.log -- what other logs do you need?

steveockey commented 8 months ago

Hi, I'm having the same issue. My fan works perfectly in HA but it does not respond to changes on the NSPanel. The NSPanel updates with changes made in HA. My fan beeps when changes are made but it doesn't beep to changes made on the NSPanel. Mine is also through Local Tuya. It worked correctly on about 4.1 (from memory) but stopped from 4.2.X. If there is any further info I can provide or testing I can assist with please let me know.

edwardtfn commented 8 months ago

Can you see anything related to this on Home Assistant logs (Settings > System > Logs)?

steveockey commented 8 months ago

I can't seem to find anything in there. I was also just playing around and found that the on and off buttons work, it is just speed up and down and the slider. Also, I'm using the US version (if that make any difference). Here is a log of the up and down button presses.

image

steveockey commented 8 months ago

I just found this that could be a factor. Appears to be a planned depreciation that the local tuya system is still using.

image

edwardtfn commented 8 months ago

I don't think this is the cause of the issue, but will investigate it. From your previous logs looks like the panel isn't sending anything to the Blueprint when you press the buttons... That is probably where the issue is.

steveockey commented 8 months ago

Is that something that I have done? Is there any other info I can provide to assist?

steveockey commented 8 months ago

For further info, here are the NsPanel logs for pressing the fan stop and fan start. When it starts again, I can see it update the screen with speed percentage but it doesn't seem to show any "page" and "key" data like the stop does. Hope this helps.

image

edwardtfn commented 8 months ago

Which panel model you have? EU, US or US Landscape? Are stop/start buttons in the panel working? I mean, you have issues with the slider only, or also the buttons?

steveockey commented 8 months ago

I have the US version in portrait. The physical button is set for toggle and that works. On the screen the start and stop work. The slider and speed up and down buttons don't change anything anymore.

edwardtfn commented 8 months ago

Could you please go to Developer Tools, then select the tab Services and look for service "Fan: Set speed", select your fan as the entity to be controlled and a percentage value, then press Call Service and please let me know if that changes the fan speed?

image

steveockey commented 8 months ago

Yes - that works. Fan speed changes to the set percentage and the fan beeps.

edwardtfn commented 8 months ago

Could you please go back to that page, select that same service again (make sure it is working) then click Go to yaml mode and share here the code?

steveockey commented 8 months ago

Confirmed to be working. The yaml code is:

service: fan.set_percentage
target:
  entity_id: fan.living_ceiling_fan
data:
  percentage: 33

(the indentation isn't showing when I post the comment)

edwardtfn commented 8 months ago

May I ask you for one more thing? On that same Services page, please try now the service "Fan: Turn on". After selecting the entity, a percentage slider should be shown and you should be able to set a different speed.

IMG_6704

  1. Is the percentage slider shown?
  2. When you click call service with the fan on, but changing the speed, anything happens?
  3. If you do that, but with the fan previously off, is the an turning on on the speed relative to the percentage selected?
irvintim commented 8 months ago

Guys, thank you so much for looking into this issue! I wish I could help with troubleshooting, but I'm not at the location where I'm having this problem. I won't be there until the weekend of the 22nd. But I'm happy to try anything out when I'm up there again next.

steveockey commented 8 months ago

Hey Edward, I have done that. Neither of those set the speed of the fan. The fan stayed at the previous speed setting regardless of whether it was off or on. When the fan was off the turn on did turn the fan on but failed to set the speed set in the service call.

edwardtfn commented 8 months ago

Ok, so it looks like some limitation on Tuya integration side to handle this service call. I will see how I can use the other call then...

By the way, which Home Assistant versions are you using? I wanna know if this issue persists with the new Tuya integration released with HA 2024.2.0 earlier this week.

irvintim commented 8 months ago

I am on 2024.1

steveockey commented 8 months ago

I am on 2024.2.1 and using LocalTuya 5.2.1

steveockey commented 8 months ago

Just doing some more playing around with the fan. I can use the fan.increase_speed from off and it will turn on the fan to 1 speed higher than it was previously running at. From off I can also use fan.set_speed and assign a required speed and this turns on the fan to the requested speed.

edwardtfn commented 8 months ago

I believe I've found a solution for that, which is already in dev and should be part of the next release.

I will close it for now, to help managing my backlog, but please feel free to comment here or reopen if the fix didn't worked.

edwardtfn commented 8 months ago

We just released a patch with solves this: v4.2.5 - Celebrating 1000 Stars with Enhanced Functionality and UI Improvements Could you please update your system and let me know if the issue was solved?

steveockey commented 8 months ago

Hey Edward, I've just loaded and tested 4.2.5 and it's all working correctly for speed control. Thanks!!!

irvintim commented 8 months ago

Fantastic news! Thank you so much Edward. I will test it out when I'm up there on the 22nd. Thanks to both of you for getting to the bottom to this and getting it fixed so quickly.

irvintim commented 8 months ago

I updated it to 4.2.6 and can confirm that the LocalTuya fan control works. Thank you for getting this workaround in so quickly.