#Create fake device from IR commands

22 messages · Page 1 of 1 (latest)

true sail
#

Is there a way to make a fake device from IR commands? I have scripts with all the IR commands but want to make it a device so I can then hook it up to dashboards and some other stuff a bit easier.

I'm sure its possible but cant seem to find documentation on it.. suspect I am using the wrong terms, could someone point me in the right direction?

median edge
#

You're really looking for entities, and there's many of those

#

What are you thinking of?

true sail
#

I have a fan, so pretty much just want to be able to do on/off, speed up/down, oscillate on/off.

I have all the IR command learned, and in scripts just so I could test them

median edge
#

So, template fan then

true sail
#

aaand that link has a fan one.. great, thanks

#

will do some reading 🙂 :ty:

true sail
#

hmm, getting a weird error with this.

Action script.office_fan_power_toggle uses action fan.turn_on which was not found.

If i run script.office_fan_power_toggle in isolation, it works fine. I don't know what fan.turn_on even is, quite odd.

fan:
  - platform: template
    fans:
      office_fan:
        friendly_name: "Office fan"
        value_template: "{{ states('input_boolean.state') }}"
        turn_on:
          action: script.office_fan_power_toggle
        turn_off:
          action: script.office_fan_power_toggle
        set_oscillating:
          service: script.office_fan_power_oscillate_horizontal
          data:
            oscillating: "{{ oscillating }}"
        speed_count: 12

I tried to use service instead of action, but it didn't change anything and I think those terms are interchangeable anyway..

true sail
gilded berry
#

can you go to the Developer tools > States tab and on the "Filter entities" field enter script.office_fan_power_toggle ? Can you check the yaml for that script?

#

I wonder if you have duplicate scripts (one with the office_fan_power_toggle entity_id and another with that as alias which you shared on the github issue)

true sail
#

Figured these might be useful too

gilded berry
#

oh, it seems that the entity id used on the template is wrong

#

you need to use the one shown in blue there

#

so script.officefan_powertoggle (you can just press the copy button next to it, just to be safe)

#

can you try using that one on the actions of the fan template?

true sail
#

@gilded berry Yeah that was it.. the reason for that is I renamed them and I guess that doesnt change their entity id's.. which makes a lot of sense.

thanks for your help on this ill update and close the github

gilded berry
#

great!

#

yeah, the alias does not change the entity_id

#

the error message has a bug, though! it was inverted since it should say "Action fan.turn_on uses action script...... which was not found"