Coder Social home page Coder Social logo

Comments (4)

belotte55 avatar belotte55 commented on May 26, 2024

Hi !
A solution could be to emulate each key to be pressed to do that like if u're using the remote
For a QN90A, i use those ommands

"switches": [
    {
        "name": "Lowest Brightness",
        "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_UP*1s,KEY_ENTER,KEY_DOWN*3,KEY_ENTER*1s,KEY_ENTER*1s,KEY_LEFT*7s,KEY_HOME*2"
    },
    {
        "name": "Low Brightness",
        "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_UP*1s,KEY_ENTER,KEY_DOWN*3,KEY_ENTER*1s,KEY_ENTER*1s,KEY_LEFT*7s,KEY_RIGHT*10,KEY_HOME*2"
    },
    {
        "name": "Full Brightness",
        "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_UP*1s,KEY_ENTER,KEY_DOWN*3,KEY_ENTER*1s,KEY_ENTER*1s,KEY_RIGHT*7s,KEY_HOME*2"
    }
]

But it does not works every time. I think sometime the delay between keys is not enough (because the interface of the TV is slow..)
I'll try a fork to fix that. I'll let u know

EDIT: There is already an option to set a delay between commands

"devices": [
    {
        "name": "Samsung TV",
        "ip": "192.168.0.1",
        "delay": 1000,                 <---------
        ...
    }
]

But it still does not works correctly. Sometimes the TV "menu" is closed (idk why, commands seems to be good) after few seconds

from homebridge-samsung-tizen.

imajhere avatar imajhere commented on May 26, 2024

from homebridge-samsung-tizen.

belotte55 avatar belotte55 commented on May 26, 2024

It finally works for me ! Using a 1200ms delay.
The process is long, buts it's automatic :)

Here's my config:

{
    "devices": [
        {
            "api_key": "",
            "device_id": "",
            "name": "Samsung TV",
            "ip": "192.168.0.x",
            "mac": "",
            "delay": 1200,
            "inputs": [],
            "switches": [
                {
                    "name": "Brightness 0%",
                    "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_ENTER,KEY_DOWN*3,KEY_ENTER,KEY_ENTER,KEY_LEFT*7s,KEY_HOME*2"
                },
                {
                    "name": "Brightness 20%",
                    "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_ENTER,KEY_DOWN*3,KEY_ENTER,KEY_ENTER,KEY_LEFT*7s,KEY_RIGHT*10,KEY_HOME*2"
                },
                {
                    "name": "Brightness 40%",
                    "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_ENTER,KEY_DOWN*3,KEY_ENTER,KEY_ENTER,KEY_LEFT*7s,KEY_RIGHT*20,KEY_HOME*2"
                },
                {
                    "name": "Brightness 60%",
                    "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_ENTER,KEY_DOWN*3,KEY_ENTER,KEY_ENTER,KEY_LEFT*7s,KEY_RIGHT*30,KEY_HOME*2"
                },
                {
                    "name": "Brightness 80%",
                    "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_ENTER,KEY_DOWN*3,KEY_ENTER,KEY_ENTER,KEY_RIGHT*7s,KEY_LEFT*10,KEY_HOME*2"
                },
                {
                    "name": "Brightness 100%",
                    "command": "KEY_HOME,KEY_LEFT*7,KEY_ENTER,KEY_ENTER,KEY_DOWN*3,KEY_ENTER,KEY_ENTER,KEY_RIGHT*7s,KEY_HOME*2"
                },
                {
                    "name": "Enter",
                    "command": "KEY_ENTER"
                }
            ]
        }
    ],
    "platform": "SamsungTizen"
}

from homebridge-samsung-tizen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.