Payload Question

Hello, am new to all home-assistant community, but decided to install then saw one of hookup videos about remote pc control.

Am using his script:

on and off functions its working and sense if pc power on/off am just copy his yaml file:

i look into code force off function added but how to enable that function in home-assistant menu I don’t know or how to write YAML file for force off button show.

??

You have a switch now. You add it to a group to display on frontend.

I think what you want to do is write a script that uses the MQTT publish service to send an MQTT message with the topic the same as your switch and the payload as “FORCE OFF”.

You can then add the script to a group to display in the user interface.

can i make switch with 3 payloads ? like

  • platform: mqtt
    name: “Test PC”
    state_topic: “state/PC”
    command_topic: “commands/PC”
    payload_on: “ON”
    payload_off: “OFF”
    payload_off: “FORCE OFF”
    retain: false

No, that isn’t possible.