Giter Club home page Giter Club logo

esphome-native-hdmi-cec's People

Contributors

minims avatar niko132 avatar palakis avatar segfly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esphome-native-hdmi-cec's Issues

Templating

Hello,

First of all thanks for this work !

I'm trying to get a Service in HomeAssistant. So i define this in esphome:

api:
  services:
    - service: hdmi_cec_send
      variables:
        cec_destination: int
        cec_data: int[]
      then:
        - hdmi_cec.send:
            destination: !lambda 'return cec_destination;'
            data: !lambda 'return cec_data;'

but i have this error :

<unicode string>:54:14: error: could not convert 'cec_data' from 'vector<int>' to 'vector<unsigned char>'

Any Idea how i can fix this ?

Unable to get the TV to turn on after power-cycling it

I have this simple code working and using HomeAssistant to send in...

cec_destination = 0
cec_data = [0x04]

...and its working to get the tv to turn on, but only when the tv is in standby mode. I'd really like to be able to turn the tv on from complete power-cycle as well. I only wired up 2 of the 3 (3rd was said to be optional) wires suggested in your readme. Perhaps 3 might work if the TV knows a device is there?

services:
    - service: hdmi_cec_send
      variables:
        cec_destination: int
        cec_data: int[]
      then:
        - hdmi_cec.send:
            destination: !lambda 'return static_cast<unsigned char>(cec_destination);'
            data: !lambda 'std::vector<unsigned char> charVector; for (int i : cec_data) { charVector.push_back(static_cast<unsigned char>(i)); } return charVector;'

I can't believe I've been all over the place and can't seem to find a "programmatic solution to turn the tv on and off that is as guaranteed as the IR/RF remote. I was really hoping CEC would be the answer. ๐Ÿ˜ข

Replacing a Pi Zero W and cec-mqtt-bridge with an ESP32 running esphome-native-hdmi-cec

First of all thank you! This is exactly what I have been looking for. Low cost and easy to set up.

I have been using a Pi Zero W with cec-mqtt-bridge for 7-8 years and that also worked great, but it requires a Pi, an SD card, installing an OS and installing lots on top of that, which isn't ideal. Furthermore, the dependencies recently updated and made it dicfficult to deploy a new Pi zero in my setup.

However, the cec-mqtt-bridge had 3 advantages that I think would be relevant to have with esphome-native-hdmi-cec:

  1. read all CEC traffic / incoming messages in Home Assistant and then decide which commands were relevant to act on in an automation. Is there an easy way to get the same information, e.g. written to a sensor with esphome-native-hdmi-cec? (Readable in Home Assistant) (I am aware that using on-device "on_message triggers" is probably more efficient, but that is easier to set up, when you have analysed the traffic and it also requires you to update the firmware everytime you think of a new trigger. Right now I am not sure what messages are sent.)
  2. send CEC commands using the CEC-o-matic format/syntax (no need for separate source and destination fields and 0x before each command etc)
  3. not having to manually figure out the physical adress of the device itself

Maybe the last one is already on the to do list and the second one is a convenience thing, but especially the first one is something I would like to achieve. Any idea if this is possible?

Implement ID

Hi,

First off LOVE THIS! after 2 months of screwing around with other options this one worked for me and saved my project!!!

Would it be possible to implement id in esphome. The reason is that I would love to use 3 HDMI CEC outputs.

Let me know hwo to buy you a coffee(tm) for all the hard work.

Not working on Seeed Xiao ESP32-C3

Very nice library, I'm glad someone refined the work from existing authors.

However, it's not working for me on seeed_xiao_esp32c3. It reports successfully transmitting frames in the logs, but on my logic analyzer I don't see the pin state change at all. I had the same issue with johnboiles library, and for the longest time, I thought the code just didn't work.

After discovering your library, and seeing that it still did not work for me, I decided to try it on a Waveshare ESP32-S3-Zero with esp32-s3-devkitc-1 and it works fine.

So I am a bit perplexed what is going on, I've double and triple checked my physical connections, verified the pins work by testing other output components the same pin, tried all the pins available on the board, and still no output.

My config is very simple to test:

esphome:
  name: basic

esp32:
  board: seeed_xiao_esp32c3
  framework:
    type: arduino
  # board: esp32-s3-devkitc-1 # Works for Waveshare ESP32-S3-Zero
  # framework:
  #   type: arduino

logger:

binary_sensor:
  - platform: gpio
    name: "CEC Send"
    pin:
      number: GPIO9 # Xiao onboard button    
      # number: GPIO0 # Waveshare ESP32-S3-Zero onboard button
      inverted: true
      mode: INPUT_PULLUP
    on_press:
      hdmi_cec.send:
        destination: 0xF # Broadcast
        data: [0x36] # "Standby" opcode                

external_components:
  - source: github://Palakis/esphome-hdmi-cec

hdmi_cec:
  pin: GPIO4
  address: 0x4
  physical_address: 0x1000

Everything seems to be fine in the logs:

[D][binary_sensor:036]: 'CEC Send': Sending state ON
[D][hdmi_cec:204]: sending frame: 4F:36
[D][hdmi_cec:218]: HDMICEC::send(): frame sent and acknowledged
[W][component:237]: Component gpio.binary_sensor took a long time for an operation (53 ms).
[W][component:238]: Components should block for at most 30 ms.
[D][binary_sensor:036]: 'CEC Send': Sending state OFF

But only my S3 will actually output data, the C3 just sits there and pretends to have done something with the line staying high.

In fact, if I put an external pulldown resistor, it actually does something, just junk on when the CEC send is invoked, but it actually does something. So I'm thinking there must be something off with the way the pin is being configured. I tried manually setting some of the pin configuration, like INPUT_OUTPUT_OPEN_DRAIN, etc. but it has no effect - except 'inverted' which results in the error "[E][hdmi_cec:232]: HDMICEC::send(): send failed after five attempts"

Thanks in advance for any pointers as to what may be going on.

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.