zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
443 stars 180 forks source link

How to trigger nodes with multiple payloads in v3.0.0 #215

Closed popy2k14 closed 9 months ago

popy2k14 commented 9 months ago

Version of the custom_component

3.0.0

Configuration

This was working < 3.0.0

service: nodered.trigger
data:
  payload:
    type: 'announce'
    text: 'Hallo, das ist ein Test!'
    volume: 35
    device: 'Wohnzimmer'
    duration: 4
target:
  entity_id: switch.alexa_say_something

Describe the bug

Can't trigger nodes with multiple payloads after v3.0.0 update

Debug log

output of connected debug:

27.9.2023, 19:15:17[node: debug 9](http://homeassistant.local:8123/api/hassio_ingress/5cIp5p9Zag5aPmJtQcunSTkM2RCIUd-qzUNTLfckqxE/#)
triggered : msg : Object
object
topic: "triggered"
_msgid: "ded8f6093d77f23d"

the values are missing.

zachowj commented 9 months ago

Version 3.0.0 had a breaking change for the trigger service. It now only has two optional properties: message and output_path.

service: nodered.trigger
data:
  message:
    payload:
      type: 'announce'
      text: 'Hallo, das ist ein Test!'
      volume: 35
      device: 'Wohnzimmer'
      duration: 4
target:
  entity_id: switch.alexa_say_something
zachowj commented 9 months ago

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/custom_integration/exposed-nodes.html#trigger-an-exposed-event-node-from-a-service-call-nodered-trigger

popy2k14 commented 9 months ago

thx for the hint. Already saw that and tried exactly that message payload. Sadly in nodered the message is empty.

In the release nodes you also mentioned: Home Assistant nodes version 0.57.0+ I have the newest HA 2023.09.3, is this version compatible?

thx

zachowj commented 9 months ago

0.57.0 is currently in beta https://github.com/zachowj/node-red-contrib-home-assistant-websocket/releases/tag/v0.57.0-beta.1

If you don't plan on running that and want the most stable performance I would revert the companion component back to 2.20.

popy2k14 commented 9 months ago

ok, thx. will go back to 2.2.0. Can you please add an info to your warning that 0.57 is in beta and not included in current stable.