Issue with node-red-contrib-home-assistant-websocket "API-CALL-SERVICE"

Interesting issue!

Using Home Assistant on a RPi and running Node-red for my automations. Using a ESP8266 running ESPHome to send some serial data. I am using UART Switch — ESPHome so very easy to set up.

uart:
  id: uart_bus
  tx_pin: GPIO1 #D3
  rx_pin: GPIO3 #D4
  baud_rate: 57600
  
switch:
  - platform: uart
    name: "Send_R"
    data: 'R'
  - platform: uart
    name: "Send_6"
    data: '6'
  - platform: uart
    name: "Send_4"
    data: '4' 

These switch entities are available in Home Assistant, and work exactly as expected. Turning the 'Send_4' switch on sends '4'. Great so far! So ESPHome is working as expected and Home Assistant is as expected.

The problem is in Node-red:
Within Node-red I am using the 'call service' node to activate the switch.... But when I set the entity in this node to say 'Send_4', the result is activates all three commands (Send_R, Send_6, Send_4).

[11:43:45][D][switch:013]: 'Send_R' Turning ON.
[11:43:45][D][switch:037]: 'Send_R': Sending state ON
[11:43:45][D][uart.switch:020]: 'Send_R': Sending data...
[11:43:45][D][switch:037]: 'Send_R': Sending state OFF
[11:43:45][D][switch:013]: 'Send_6' Turning ON.
[11:43:45][D][switch:037]: 'Send_6': Sending state ON
[11:43:45][D][uart.switch:020]: 'Send_6': Sending data...
[11:43:45][D][switch:037]: 'Send_6': Sending state OFF
[11:43:45][D][switch:013]: 'Send_4' Turning ON.
[11:43:45][D][switch:037]: 'Send_4': Sending state ON
[11:43:45][D][uart.switch:020]: 'Send_4': Sending data...
[11:43:45][D][switch:037]: 'Send_4': Sending state OFF

Using version 0.46.0 of the contrib-node.

Is this a bug? Any solution?
Thank you!

Seems everything under switch is sent if any individual task under switch is called using this api-service-call

For example, calling any one of these results in all three activating:

Switch:
  - platform: uart
    name: "Send_R"
    data: 'R'

  - platform: template
    name: "Switch_Send_6"
    id: switch_send_6
    turn_on_action:
      - uart.write: '6'

  - platform: template
    name: "Switch_Send_4"
    id: switch_send_4
    turn_on_action:
      - uart.write: '4'

Solved! My lack of understanding - don't include the area and device in the node - otherwise all connected entities get triggered.....

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.