Is it possible to have a Device with no Report State & a SINGLE command ("on/off" or "Activate" or "Feed-The-Chickens")

I have a few devices that are controlled by an RF signal. They don’t have an On/Off state that Home Assistant knows anything about, they just have generic Power buttons & Start buttons.
Sometimes I even have to push the button twice to get it to turn on or off.
I’m sure other have had similar needs as they can be used for things like pushing the button to turn a gear that dumps a serving of dogfood into the feed dish, you don’t unfeed the dog the next time you push it. Of to send the daily statistics report to your boss, you don’t unsend the report the next time, etc.

The problem is that Home Assistant recognizes them as toggle switches, & keeps the State as whatever the last was.

I’ve been looking for a way to have them as devices without a State
But the best I can find is a Button but even those change colors to indicate the On & Off states.
I looked into a custom button integration that should allow me to have them without color changing so they would at least be on the dashboard without random states, but that’s not a great solution, just the best I can find.
I feel there has to be a way to have an entity that has a single “Push-To-Send-This-Command” without a “I’m-In-This-State” reply to it, but I haven’t been able to find one, & have wasted 30 minutes or an hour looking for one dozens of times to no avail.

I have a device that has a switched plug along with a nightlight on it. For that device I have 3 toggles, 1 is to turn on the switch, 1 is to turn on the light, & the 3rd is to turn the whole thing On or Off. I’m annoyed by this device a little because the “Whole Device” button always resets itself after being pressed to the OFF position. Regardless if all parts are On, Off, or Mixed with 1 On & the other Off it always jumps back to off. When I tested it it was quite annoying because if I want to turn everything off I have to press it to turn them on, then within the second before it resets press again to turn them both off. I don’t ever use that switch so it isn’t a big hassle for me, but if at least that functionality was available for these switches that’d be an improvement. On a button the color would change to indicate it had been pressed & go back.

Is there a way to do this?
Is there at least a way that’s better than just an uncolored button?
Is there a way to make a switch change State back to off automatically after being pressed without sending the Off command?

Not sure if this helps but…
In case of fire&forget there is no way other than trying to resolve this via another sensor.
For my garagedoor (rf too) I have a open/close door sensor installed
For my mailbox (vibraiton sensor) I donot have one but I count the signals sent and store that in an inputhelper and reset the vibration sensor (to off) after vibration is received (on). Without a sensor tracking the real state it will become complex.

1 Like

How is that possible if:

Just use a button tap_action to call a script that sends your RF signal. Or if sending your RF signal is a service, then specify that directly in the tap action.

The button will only change colour while the script runs. It should be so brief that you won’t even notice it. If you want it to stay coloured for just a bit, put a delay of one second as the last action of the script.

1 Like

It’s possible because I’m not saying I found anything with a device without states, but that that is the closest I have found.
All I find have the state for some stupid reason, even though there are plenty of devices that wouldn’t need one.

does this send a signal? when I’ve tried to do something like this it turned it “OFF” but send the command too. An example of this being a problem would be like the “Feed The Dog” I mentioned (Not something I actually use) it would push the “button” twice, giving the dog 2 servings instead of 1, or if the 1st wasn’t finished possibly causing a problem or something.

That sounds like a doable solution. The only problem is that the “State” is still going to be either On or OFF. 1 of the devices I’m working with the OFF command will trigger the device, but also causes other things to mess up. I’m working on a different solution for that, but the Single-Command-No-State would fix both.

Thanks for the answer though, this is better than what i currently have at least.

No, I just change the state of the vibration sensor else it stays ‘on’ all the time and thus won’t trigger with the next vibration detection. Note that there are rf sensors that work both ways too

1 Like

I get that. for a vibration sensor it doesn’t trigger anything because there is nothing to trigger, but doing the same for a switch might not be the same was my concern.

What do you mean “Work both ways too”? If you mean that have a different On & Off that’s what I’m talking about. The one I’m using the OFF is the same as the ON but also has another function of putting it to “Sleep”. But if I disconnect the transmitter device, switch it to OFF then reconnect the transmitter it works the way I want, if I don’t every other time I use it I have to push the button, then wait before the button goes, that’s not a big deal, it’s like maybe 2 seconds, but completely unnecessary. The intention of the OFF is because if you have another device plugged into it, it will power them both off because it essentially turns off the accessory plug when it’s in “Sleep” but the plug doesn’t have any other control functions. I’m not sure if I would use it as a regular power extension, but with it as it is that’s not even a possibility unless I want it to work only half the time.

If you have two commands and no state feedback the best thing you can do is two buttons:

Screenshot 2022-08-10 at 19-02-54 Overview – Home Assistant

I meant there are also RF sensors that also will reset and send a signal, but also that you can trigger … I myself donot have them as found them too expensive at the time (but that was partially a mistake). I like to the RF part as the range is a lot higher than wifi/zigbee/etc. but (!!) it is also insecure. When I put my RF scanner to on, I received quite a few signals from lightswitches at neighbours, allowing me to theoretically swithc them on/off

Check out the helper Input Button - Home Assistant
Or you can use a input_boolean and then use a Automation the set the input_boolean to OFF after 1 sec. after the button is pressed.

1 Like

In that regard I just need 1. Power instead of On & Off If I ever decide I want the Power Plus Sometimes Sleep It probably wouldn’t ever be used in the same space.

What you need want and what you can actually have that works well based on the limitations your devices have are two separate things.

Yes, but the problem isn’t with the devices limitations. There are devices that don’t have an OFF button at all. It has a POWER button & a SLEEP button, or ones that have an ACTION button & no power function at all. Why doesn’t Home Assistant have a way of dealing with these? It shouldn’t be required to jump through hoops when it’s such a basic function. It’s like a TV Remote, many Remotes have a seperate command for ON & for OFF, while others just have 1 command for TOGGLE-POWER-STATE

It’s not home assistant that has the issue. It’s your device’s lack of state feedback and the fact that it has discrete commands for on and off, and no toggle command. Without state feedback it is not possible to reliably implement a toggle command from discrete commands.

1 Like

How many times do I have to say IT DOES NOT HAVE DESCRETE COMMANDS, It only has 2 commands. Those commands DO NOT RELATE TO EACH OTHER. The 1 command IS a toggle command, but without state feedback Home Assistant won’t treat it as a toggle. That’s the problem.
Home Assistant sees 2 commands & has to call 1 ON & the other OFF. That’s just 1 of the devices that this is an issue with.
Another has a single command. Just 1. Nothing more. So for Home Assistant it turns it “On” then it has to be turned off before it can be used again.

The device works as it is intended to. Home Assistant does not work with the devices. RF devices CANNOT have state feedback. Home Assistant lacks to ability to have an entity that has a single action command. To make it appear to do so I have to trick it to turning back off without sending a signal, but when the entity is used it always does a toggle. Why? There’s no reason that is required.

You have this Moderator tag, but almost every one of your comments seems more like trolling. Your 1st response you literally didn’t understand basic English, now you’re incorrectly twisting semantics to try to make it sound like the problem is with the device. Google can do it. Home Assistant SHOULD be more customizable than Google, not less.

Ok lets start again.

Apologies for misinterpreting your request.

What integration are you using to control your RF devices?

If that integration is creating a toggle switch instead of exposing a service to to toggle your device perhaps you need to use a different integration, or connect to it in a different way.

That’s my whole question. IS there another way?
From everything I can find the only kind of switches that exist in Home Assistant are Toggle & Dimmer. If I can find another I can work it out myself, but the problem is that I cannot find any kind of switch-type entities except the 2. So far the best I have been able to do is to use the Broadlink remote device to send the signals, in that case I can use the Service: Remote: Send Command, but that doesn’t work great because it creates a switch with just an ON command & nothing for the OFF command. I tried doing a custom switch with something awhile ago & it had the problem that it didn’t work if you had the same command for ON & OFF. Which was weird because some of the integrations seem to have the same command on both without issue. The devices imported from Tuya are worse because even when Tuya works fine, Home Assistant sees the need to change them to Toggle Switches & put the 2 commands on ON & OFF instead of leaving them as independent buttons.

I dunno, I find it harder than it needs to be to find things in Home Assistant, especially since things change so much here.
Like trying to use HASS.Agent, an example I’m currently dealing with but the same applies to 80% of things here. The instructions are pretty typical of Home Assistant things from my experience, they lack proper completeness.

Installation
The easiest way to install is to use HACS. 
Simply search for **HASS.Agent MediaPlayer**, install and restart Home Assistant.

If you want to manually install, copy the `hass_agent_mediaplayer` folder into the
`config\custom_components` folder of your Home Assistant instance, and restart.

Cool, so it’s installed… How do I use it?

Configuration
Please consult the documentation for more info on configuring and using this integration: MediaPlayer Usage & Examples

Alright…

The HASS.Agent-MediaPlayer integration exposes itself as a media_player integration, and has to be configured as such:

media_player: 
  name: "hass agent test mediaplayer"
  platform: hass_agent_mediaplayer
  host: 10.0.0.5
  port: 5115 [optional]

Replace the `host` value with the IP of the device that has an HASS.Agent instance running. To find your IP, run `ipconfig` in a command prompt on your PC. Look for the value after `IPv4 Address`. Optionally replace `5115` if you've configured a different port, normally you shouldn't have to.

Restart Home Assistant to load your configuration.

That’s it… It doesn’t say where to put that, it doesn’t work if you put it in Configuration.yaml though it will show up at least, just doesn’t have any function. But if you try to add 2 it throws errors. It’s a pretty basic use of a Windows Computer agent to have more than 1 in a house… So how do you do that? Same problem with the Template Lights, They don’t say where to put the code, & it causes a Configuration invalid! in Configuration.yaml

But this here is annoying because there are plenty of uses for a Stateless button. Just from a common integration, Asus Routers, Netgear Routers, & I’m sure every other, have a Reboot Router button. But that button in Home Assistant is always a toggle switch, even if it is disguised, so I’ve more or less given up on the idea of trying to find one because I’m fairly confident now that for some reason Home Assistant isn’t smart enough to handle it for some reason. I just don’t understand why

Yes, so rather than creating an entity, you use a service to call your command, like this:

OK, I’m not familiar with the Broadlink remote but I have had similar remote devices before I gave up on stateless control (iTach IP2IR).

Does the Broadlink integration really need to create a switch?

Normally you can just use the remote.send_command in action sequences or tap_actions.

An example dashboard button, that calls a script so that you get a 1 second colour change of the button icon:

scripts.yaml

toggle_my_device:
  sequence:
    - service: remote.send_command
      target:
        entity_id: remote.my_rf_remote # your broadlink remote here
      data:
        command: "Toggle My Device" # the name of your toggle command here
    - delay: 1 # used to delay finishing of the script so you see the button flash colour

button card config:

type: button
entity: script.toggle_my_device
name: Toggle My Device
show_state: true
icon: "mdi:power-cycle"
tap_action:
  action: call-service
  service: script.toggle_my_device

Now you could have used the service remote.send_command directly in the button tap action but it would execute so quickly that you may not see any colour feedback (which was a requirement from your posts earlier).

But that doesn’t solve the problem fully. That’s a Dashboard solution. Outside of the dashboard there is no Device to exist, which means it cannot be used in other services. In SmartThings you can have a button to push to ring a doorbell chime. In home assistant if you were integrating with SmartThings, SmartThings will need a device otherwise it cannot interact with it, so a Service: Send Command doesn’t work.

It doesn’t but without creating a device the ability to integrate is more limited. But the Braodlink integration itself is not great, so that’s a problem with the integration. As far as Broadlink is concerned, with the Braodlink App, Yes, you have to create a device, then send commands to that device. That’s actually one of things I’m currently working to try to get to work, but the stateless problem makes it difficult. I have a number of issues that a stateless button/switch entity would fix, that’s why I was looking for one.
The benefit of the Broadlink is that it can send RF commands as well as IR commands. I actually don’t use it for IR commands at all because I have 6 Harmony Hubs that do a better job of that & are easier to work with.

As far as the Broadlink I’ll give you an example of one of the problems I’m dealing with, using my home’s RF overhead Ceiling Fan Lights & trying to control them with the Harmony Remote.

  • I have a Harmony Hub that I use to control my TV that also has Home Control buttons on it.
  • I can use the Home Control buttons to control certain devices even when the remote is not in an activity & all the other buttons don’t work.
  • The list of devices it can control however is quite limited. Phillips Hue, SmartThings, Lutron Bridge, Honeywell WiFi Thermostat, Ecobee Thermostat, August Lock, Insteon Hub, Lifx Smart Bulbs, & Hunter Douglas Blinds. Those are the only devices that can be assigned to those buttons & I’m pretty sure the Blinds & Thermostats & Locks can’t, they can just be added for scene control so they are in the Home Control category.
  • I can add pretty much anything from Home Assistant via the Emulated Roku, but those act like remote buttons & cannot be used for the Home Control buttons, just for like, in an activity I could make the 3 button run a script in HA or make the Channel Up button turn on the Garage Light.
  • I have setup a SmartThings SmartApp to interact with Home Assistant devices. There is also a Phillips Hue Emulated Hub, but that seems to have problems & SmartThings seems to work better.
  • SmartThings can import the Scripts & they can be used within SmartThings, but the Harmony will not import them. So to make them work I have to create an Entity that is either a Light or a Switch for them to work.
    • Ideally I’m trying to make a Light that has the ability to Dim, but without a State that doesn’t seem to be an option as sending a remote code to Dim on the Template Light requires a brightness state to be reported.
  • A Switch crated from the remote command works, but as the OFF command cannot be the same as the ON command, when pressed for OFF it does nothing, so sometimes requires 2 presses to use. This is what I’m currently using as I try to get a better system.

It wasn’t a requirement, I was just saying that the button not changing would be what’s needed, but having it change to indicate a press would be better than it not giving any indication that it was pressed.

Yes it can:

trigger:
# some automation trigger here
action:
  - service: remote.send_command
    target:
      entity_id: remote.my_rf_remote # your broadlink remote here
    data:
      command: "Toggle My Device" # the name of your toggle command here

Unless I am misunderstanding where you want to use it?

If so, can you tell me where you want to use it?

I gave an example