Script not working

I’m in the process of moving to the latest HA install which I now have installed & running ( 0.106.5) This is coming from an old install (0.72) where I’m now in the process of integrating my old working configs into the new install.

I have issues at the moment with two scripts where they are showing the same error when I do a test

Error executing script script.weather. Invalid data for call_service at pos 1: must contain at least one of entity_id, area_id.

The above error is from the below script which use to work

weather.yaml

alias: Weather
sequence:
  - service: remote.send_command
    data:
      command: Mute
      device: 52435888
  
  - service: tts.google_translate_say
    data_template:
      entity_id: media_player.kitchen_home
      message: >
        {% if now().strftime("%H")|int < 12 %}
        Good morning.
        {% elif now().strftime("%H")|int < 18 %}
        Good afternoon.
        {% else %}
        Good evening.
        {% endif %}
        It's currently {{states.sensor.dark_sky_summary.state}} outdoors and {{states.sensor.temperature_158d0001e58873.state|round}} degrees indoors. Today will be {{states.sensor.dark_sky_hourly_summary.state|replace(".", "")}}, with a high of {{states.sensor.dark_sky_daytime_high_temperature.state|round}} degrees in Mansfield.
  - delay:
      seconds: 15

  - service: remote.send_command
    data:
      command: Mute
      device: 52435888

Any help would be appreciated.

Thanks

What remote are you sending the mute command to?

(logitech harmony)

  - service: remote.send_command
    data:
      command: Mute
      device: 52435888

Yamaha AMP

        "Yamaha Amp": {
            "commands": [
                "PowerOff",
                "PowerOn",
                "PowerToggle",
                "Mute",
                "VolumeDown",
                "VolumeUp",
                "BassExtension",
                "BluetoothStandBy",
                "ClearVoice",
                "Dimmer",
                "InputAnalog",
                "InputBluetooth",
                "InputHdmi",
                "InputTv",
                "Stereo",
                "SubwooferDown",
                "SubwooferUp",
                "Surround"
            ],
            "id": "52435888"

It works fine with the old HA install. So much has changed, it’s hard to even keep up :slight_smile:

0.72.x was released in June 2018, being that you haven’t updated for 20 months - yes, a lot has changed :wink:

@kanga_who OK &? Do you have anything to add that will/would be helpful or you just trolling?

I’m assuming you have gone to the scripts page on the HA website and compared your config to current listed? I assume you have also checked the Yamaha configs have also not changed?

Did you read the docs for the remote service call? The error is telling you exactly what the problem is.

OK, so I broke down my script & can confirm that after adding the below to ‘Darksky’ in the config

    forecast:
      - 0
    hourly_forecast:
      - 0
      - 1

then restarting HA & using the new sensors & removing the

  - service: remote.send_command
    data:
      command: Mute
      device: 52435888

All worked fine. Soon as I add it back I get the first error I posted, so I guess its something to do with that. Will keep plodding on…

So got this working now by adding an extra line in below the remote.send command

entity_id: remote.harmony_hub

Final working config

alias: Weather
sequence:
  - service: remote.send_command
    data:
      entity_id: remote.harmony_hub
      command: Mute
      device: 52435888
  
  - service: tts.google_translate_say
    data_template:
      entity_id: media_player.kitchen_home
      message: >
        {% if now().strftime("%H")|int < 12 %}
        Good morning.
        {% elif now().strftime("%H")|int < 18 %}
        Good afternoon.
        {% else %}
        Good evening.
        {% endif %}
        It's currently {{states.sensor.dark_sky_summary_0d.state}} outdoors and {{states.sensor.temperature_158d0001e58873.state|round}} degrees indoors. Today will be {{states.sensor.dark_sky_hourly_summary.state|replace(".", "")}}, with a high of {{states.sensor.dark_sky_daytime_high_temperature_0d.state|round}} degrees in Mansfield.
  
  - delay:
      seconds: 15

  - service: remote.send_command
    data:
      entity_id: remote.harmony_hub
      command: Mute
      device: 52435888
  

As @finity said, that’s what the error message was saying (you need entity ID or area ID in the service call at position 1).

Indeed

Cheers all