Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat IR commands based on the JSON file command itself #165

Open
FluffyGhoster opened this issue Dec 19, 2024 · 1 comment
Open

Repeat IR commands based on the JSON file command itself #165

FluffyGhoster opened this issue Dec 19, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request PR required

Comments

@FluffyGhoster
Copy link

Hello!

I am trying to prepare a JSON for my ceiling fan, I have captured the IR codes already etc. etc.

Problem: This is a dumb fan, to set the fan speed you need to press the button X times (speed 1 (low) = 1 press, speed 2 (medium) = 2 presses, speed 3 (high) = 3 presses)

Therefore I need to set the JSON to repeat the same command 2 or 3 times to archieve the desired fan speed, I tried with using an array but it doesn't seem it's working as expected, I believe it doesn't play the whole array but only one of the codes in the array? Not sure

This is the JSON I made so far:

{
    "manufacturer": "ItalExport",
    "supportedModels": ["Unknown"],
    "supportedController": "Broadlink",
    "commandsEncoding": "Base64",
    "speed": ["low", "medium", "high"],
    "commands": {
      "off": "JgCoAAscDQ8aHA4PGg8aEBodDBwOHA4cDA8bHA0AAeMOGw4PGh0MDxsQGg4aHQ0dDB4MGw8OGh0MAAHkDRwODhsdDA8bDhoQGh0KHwofEBoNDxscDAAB5A4aDw8aHAwQGw0bDhsdDR0MHQwdDQ8aHQ0AAeMOGw4OGx0MDxoPGw4bHQwcDh0MHQwPGx0MAAHkDRwNDhscDQ8bERkPGR0NHA0dDRwNHQwdDQANBQ",
      "default": {
        "low": "JgDgAAwbDg4bHA4OGw4bDh0bDhsNHA4cDRwNDhwAAeIPGw4NHRsODRwNHA4bHA4bDhwOGw4bDg4cAAHiDhsODhscDw0bDhwNHBwNHA4bDhwNHA0PGwAB4w4bDQ4cHA4OGw4bDhscDhsOHA0cDhsODhsAAeMOGw4OGxwODxoOHA0dGw4bDRwOHA0cDQ8bAAHjDhsNDxscDQ4cDhsOHB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AwbDg4bHA4OGw4bDh0bDhsNHA4cDRwNDhwAAeIPGw4NHRsODRwNHA4bHA4bDhwOGw4bDg4cAAHiDhsODhscDw0bDhwNHBwNHA4bDhwNHA0PGwAB4w4bDQ4cHA4OGw4bDhscDhsOHA0cDhsODhsAAeMOGw4OGxwODxoOHA0dGw4bDRwOHA0cDQ8bAAHjDhsNDxscDQ4cDhsOHBsOGw4cDRwOHA0OHAAB4g4bDg4cGw4OHA0bDxscDRwOGw4cDRwODhsAAeMOGw4OGxwNDhwOGw4bHA4cDB0OGw4cDRwNAA0F",
          "JgDgAAwbDg4bHA4OGw4bDh0bDhsNHA4cDRwNDhwAAeIPGw4NHRsODRwNHA4bHA4bDhwOGw4bDg4cAAHiDhsODhscDw0bDhwNHBwNHA4bDhwNHA0PGwAB4w4bDQ4cHA4OGw4bDhscDhsOHA0cDhsODhsAAeMOGw4OGxwODxoOHA0dGw4bDRwOHA0cDQ8bAAHjDhsNDxscDQ4cDhsOHBsOGw4cDRwOHA0OHAAB4g4bDg4cGw4OHA0bDxscDRwOGw4cDRwODhsAAeMOGw4OGxwNDhwOGw4bHA4cDB0OGw4cDRwNAA0F"
        ]
      }
    }
  }

With the relative configuration of the entity:

fan:
  - platform: smartir
    name: Ventilatore Sala
    unique_id: smartir_ventilatore_sala
    device_code: 1400
    controller_data:
      controller_type: Broadlink
      remote_entity: remote.rm4_sala_remote
      delay_secs: 0.5
      num_repeats: 1

I would like to have a way to tell it to play all N commands in the array, possibly setting the delay between them (in the JSON file, as they are entity specific). Would be super if there was a way to also tell it to first send the "off" state, then set the desired one, so it always resets and goes to the correct speed, but that's not super important at the moment. Would it be possible to add? Or am I missing something and it's already there, and I just can't figure out how to make it do it?

Thank!

@FluffyGhoster FluffyGhoster added the enhancement New feature or request label Dec 19, 2024
@litinoveweedle
Copy link
Owner

Hello, it "might" be useful to implement this, but this requires a lot of changes in the code. Also I am bit skeptic if this would be useful for other users as well. The good think is, this could be also theoretically useful for some media_player class devices.

I will keep this open for now - if there will be broader interest in this feature and/or I will have more time to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR required
Projects
None yet
Development

No branches or pull requests

2 participants