Dummy Switch - "fake switch"

Hello, I am new in Home Assistant and i need a little help. I want to create “fake switch”, that will be integrated in HomeKit and Google Assistant. When i will toggle this switch in Google Assistant, it will be also toggled in HomeKit. In HomeKit i will create an automation, when this switch is on, open the garage and when is off, close the garage. Can anybody please help me? I will need a little help with the configuration, because i am new in Home Assistant. I know how to integrate HomeKit and Google assistant, but i dont know how to create this “fake switch”. Thanks for every comment

Settings ->Devices & services → Helpers → + Create helper → Toggle

2 Likes

any way to do this as a switch, not a boolean?

Any specific reason why a boolean is a problem ?

It will act like a on/off switch, in my use case I use it to pause motion based events if I’m busy in the garden

image

Which I use in this button

code here
type: custom:button-card
color_type: card
entity: input_boolean.motion_detection_disabled
name: Motion Alerts
size: 10%
state:
  - value: 'on'
    color: red
    icon: mdi:alert
    styles:
      card:
        - animation: blink 2s ease infinite
  - operator: default
    color: green
    icon: mdi:shield-check

image

To act as a trigger for an automation

I’d like this too, because a the “generic hydrostat” and “generic thermostat” helpers require it to be a switch rather than allowing it to be an input boolean.

2 Likes

Create a toggle, and then a template switch that controls it.

In the UI, that means setting the value template to e.g.:

{{ is_state('input_boolean.hygrostat_output', 'on') }}

And then the actions to turn the boolean on and off:

action: input_boolean.turn_on
entity_id: input_boolean.hygrostat_output

you can do it very easily:

switch:
  - platform: template
    switches:
      dummy:
        friendly_name: "Dummy"
        unique_id: dummy_id
        turn_on:
          action: homeassistant.turn_on
          target:
            entity_id: switch.dummy
        turn_off:
          action: homeassistant.turn_off
          target:
            entity_id: switch.dummy

the action itself is to turn the swith on and off. Easy peasy :slight_smile: EDIT: it will stay in unknown state when you create it, but as soon you turn it on or off it will be ok.

@Smanny, thanks for the YAML equivalent, I couldn’t find a way to enter that, but should have included it.

If you use is_state, you don’t need to worry about it being undefined/unknown.

no need to, it is unknow only when you create it and you don’t solve it with is_state because it has no state in that moment. When you turn it on or off, it will keep and retain the state

@Smanny where exactly do you enter that YAML? Under Devices->Helpers there doesnt appear to be a way to add that

follow this: Configuration.yaml - Home Assistant

it can be done in configuration.yaml or in any other yaml file if you link it inside configuration.yaml