Blackymas / NSPanel_HA_Blueprint

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

rttl service broken after upgrade to 4.3.0 #1901

Closed rbr101 closed 3 months ago

rbr101 commented 3 months ago

TFT Version

4.3.0

ESPHome Version

4.3.0

Blueprint Version

4.3.0

Panel Model

EU

What is the bug?

The RTTL service was changed, but does not work anymore in version 4.3.0 As per documentation:

service: esphome.<your_panel_name>_rtttl_play
data:
  tone: "d=4,o=5,b=140:c,e,g,8p,c6,e6,g6,8p,c7,p"

Does not work, the logs show:

[09:28:31][D][rtttl:051]: Playing song d=4,o=5,b=140
[09:28:31][E][rtttl:056]: Missing 'd='

Before 4.3.0 i was using :

{
    "song_str": ">- smb:d=4,o=5,b=100:16e6,16e6,32p,8e6,16c6,8e6,8g6,8p,8g,8p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d"
}

I use this for specific timers , for example a timer for toothbrush time for my kids.

/R

Steps to Reproduce

Execute the rttl service in homeassistant

Your Panel's YAML

No response

ESPHome Logs

[09:28:31][D][rtttl:051]: Playing song d=4,o=5,b=140
[09:28:31][E][rtttl:056]: Missing 'd='

Home Assistant Logs

No response

edwardtfn commented 3 months ago

🤔 Which version are you coming from? I will have to investigate this, as the change was only on naming:

v4.2

    ##### Service to play a rtttl tones #####
    # Example tones : https://codebender.cc/sketch:109888#RTTTL%20Songs.ino
    - service: play_rtttl
      variables:
        song_str: string
      then:
        - rtttl.play:
            rtttl: !lambda 'return song_str;'

v4.3

    # Plays melodies encoded in RTTTL format, suitable for audio feedback, notifications, or simple tunes.
    - service: rtttl_play
      variables:
        tone: string  # The RTTTL string for the melody to be played. It should follow the RTTTL format, including the melody's name, default settings, and a sequence of notes.
      then:
        - rtttl.play:
            rtttl: !lambda 'return tone;'
rbr101 commented 3 months ago

I was using v4.2 and then latest minor when it stil worked. But yesterday after upgrading to 4.3 no sound anymore ....

kroessig commented 3 months ago

i use

service: esphome.panelwozi_rtttl_play
data:
  tone: >-
    Don'tcare:d=4,o=5,b=125:16f,16e,16f,16e,16f,16e,8d,16e,16d,16e,16d,16e,16d,16c,16d,d

and it does work. but i have issues with rtttl_play in automatisations - But I haven't had time to follow up on it yet and so haven't reported it

rbr101 commented 3 months ago

Hi,

It seems to work after some more testing, don't know why it didn't work before.

So closing this one.

Thanks, R

MichaelHeimann commented 3 months ago

I had the same issue, "play_rtttl" -> "rtttl_play" and "song_str" -> "tone" fixed it.