Giter Club home page Giter Club logo

Comments (35)

mitch7391 avatar mitch7391 commented on July 20, 2024 1

Also this isn't making me feel good about whether I set this all up right...
image

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024 1

Thanks @tiagofreire-pt, I think that was probably the one place I didn't look. Found that I had something wrong as none of it populated, fixed that and now so far the only thing I have working is the sensor the 'Source'; which is a good start considering how much trouble I have had so far. I am fairly certain everything else is correct as I have following everything else exactly (except having to manually create all the files and they seem fine. One thing I had to change was the MAC address for my smart phone, as this didn't work and MQTT Explorer showed a different MAC address (so I have now used that, but still no luck). The one thing I am most suspect about is whether I did the cert file correctly. I will do a little more digging before asking any more questions :) thank you for being so patient with me so far!

image

from home_assistant_hisense_tv.

carvan avatar carvan commented on July 20, 2024 1

I just gave that a go and now have a second 'Hisense_TV' that says 'away', I then added another device to make sure it works (Android_Tablet) and that is showing 'home'. I wonder now if this is an issue with the fact that I cannot even ping it from command prompt in windows? I figured this was a problem with the encrypted MQTT used? Or should I be able to ping the TV from command prompt? Here is what I see now in HA:

image

I just finished to set this up and came across this thread here. After many testing I've been doing before finding this project, I can safely say the TV is not pingable. The only way I found to get the TV status is by using a command line sensor which I found in the HA community:
- platform: command_line name: Hisense TV Status command: /bin/bash -c "(echo > /dev/tcp/192.168.5.32/10001) > /dev/null 2>&1 && echo On || echo Off" value_template: '{{ value }}' command_timeout: 150
The command above just verify the tv accepts connections on that port and set the status to ON if the TV accept the request or to OFF if it doesn't.

As of the whole configuration with Hisense through MQTT I can say it works very fine and I wanted to take this chance to thank the author !

from home_assistant_hisense_tv.

carvan avatar carvan commented on July 20, 2024 1

@carvan thanks for the information and I have also come to the realisation that the TV is not pingable without some work around like that. I am alongside this trying to work out a solution through shell scripts to use in Homebridge instead and the above will be quite handy. Are you able to provide me a link to where you found that just so I can read a bit more about it?

Also not knowing much MQTT, but do you think exposing the ping is something that is a software fix if I was able to harass Hisense enough to include in a firmware update? Or would that not be possible?

Sure, that's where I found that string: https://community.home-assistant.io/t/ping-a-port-to-check-if-device-is-online/151859.

image

Just not sure why it says there's no state history as when you click on the card you will get it anyway:

image

As of your question about asking Hisense to expose the ping, I really don't think this is something they will do, don't see the reason why they should. I'd just work around it using the hint above. It works pretty well and it's not tied to HA as you can use it everywhere being a simple bash command.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024 1

Awesome :) thanks @carvan

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024 1

@tiagofreire-pt i think I am going to abandon this one, but would really like to thank you for all of your help and guidance; it was very much appreciated! In the end it was essentially working, but I will be pursuing another method.

I had three methods of this project on the go; your integration in HA, a MQTT plug-in in Homebridge and shell script method for a plug-in that allows you to create any accessory in Homebridge using various methods in shell (this one is so far the winner).

I am not sure if you wanted to close this issue? As I’m sure what we covered here could help another newbie in the future. Thanks again :)

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024 1

@mitch7391 , you're welcome.

I'm sad that you couldn't get this to work. Nevertheless, I'll leave this issue open for other new users getting some visibility on solutions for their own most common pain-points setting this up. :)

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Perhaps the 'core' HA folder is my 'config' folder? So my folder would be config/shared/mosquito/ ?

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

'Put this inside a hisense.conf, in the Home Assistant Core (HA) folder /share/mosquitto/:'

In my File Editor Web UI, I cannot find a Home Assistant Core (HA) or share folder. Am I to create these folders? Should they already be there? Am I looking in the wrong place? Sorry for such simple questions but this just a platform I have no idea about.

That folder is accessible on this path:

Windows: \\YOUR_HA_LAN_IP\share\mosquitto
Linux: smb://YOUR_HA_LAN_IP/share/mosquitto

For easy access on Windows or Linux, you could install the Home Assistant Samba add-on, and then access directly to that path.

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

I just updated the tutorial, giving that part could be non easily understandable for new HA users.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Thank you for that @tiagofreire-pt :) just another question once I have got that far, should I be expecting the 'mosquitto' folder to be already existing in my 'share' folder? Even though I have installed Mosquitto Broker, I can see its logs that it says this:

[20:32:51] INFO: Setup mosquitto configuration
[20:32:51] WARNING: SSL not enabled - No valid certs found!
[20:32:51] INFO: No local user available
[20:32:51] INFO: Initialize Hass.io Add-on services
[20:32:51] INFO: Initialize Home Assistant discovery
[20:32:52] INFO: Start Mosquitto daemon
1595248372: Error: Unable to open include_dir '/share/mosquitto'.
1595248372: Error found at /etc/mosquitto.conf:29.

This to me sounds like it adds the folder itself, but maybe I haven't set something up correctly with Mosquitto Broker.

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

Create the folder, as it seems that might not be there already.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

I ended up creating the folder and the .conf file, set up the terminal addon but it won't let me install openssl through any method I can find online. It would seem how I am able to use the linux terminal on hassio vs how I am used to using it on Homebridge or even Raspbian seems to somehow be different (won't allow me to use certain commands).

I now wondering if there is a difference between the hassio image I have put on my raspberry pi and the OS image you use? If that is the case, sorry if I have wasted your time.

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

I now wondering if there is a difference between the hassio image I have put on my raspberry pi and the OS image you use? If that is the case, sorry if I have wasted your time.

The OS used in the HA images is the minimum to run the docker container.

You have to gain access to a fully functional GNU/Linux distribution on you LAN. Probably, the easiest manner is to install Ubuntu or Debian in a sdcard and boot it on the Rpi that you have, temporarily and just to get that information about the certificates. Or flash a USB stick and boot it on your PC instead, leaving the Rpi sdcard as is and with HA.

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

If you have an Android phone or Box, you may try running the openssl command there, instead.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Sorry for the late reply @tiagofreire-pt, I had to manually create a lot of these files as I went, but now got as far as creating a manual lovelace card. How do I go about doing that? Just did a quick google myself, but not really finding what I need. At this stage should I be seeing anything in HA for the TV yet?

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

On the list where you select the card wanted from the list of HA templates, at the very bottom there is a manual type card.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

@tiagofreire-pt sorry I cannot find that... I have tried to manually look through everything, but must be missing something. This is the side bar menu I have:
image

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

You need to click first on the top right "stacked three dots", and then on Configure UI:

imagem

Next, on the bottom right, click on the + sign:

imagem

At the very bottom of the new pop-up, select Manual:

imagem

Then, paste the yaml code, and hit save:

imagem

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

@tiagofreire-pt this line here in my 'hisense.conf'; do I need to change it to be the full topic?
image

And for the cert file, there was a bunch of stuff that came back from running the command that was before, inbetween and after the two certificates; was I supposed to include all of that in my cert file? I only included the two main cert parts like you did in your example (without all the extra stuff).

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

@tiagofreire-pt this line here in my 'hisense.conf'; do I need to change it to be the full topic?
image

No. The conf that you have there is correct and enough.

And for the cert file, there was a bunch of stuff that came back from running the command that was before, inbetween and after the two certificates; was I supposed to include all of that in my cert file? I only included the two main cert parts like you did in your example (without all the extra stuff).

No, just use the template given on the tutorial, pasting the two certificates signatures only (as shown).

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

@tiagofreire-pt hmm sounds like I have those right then, I can’t find any other areas that would be wrong. I have also switched between using the MAC address of my iphone vs the MAC address that MQTT Explorer is showing in the command; both don’t seem to improve it.

The weird thing is the sensor for ‘input’ Is working but nothing else is; however that is a command that doesn’t require the MAC address. Do you have any thoughts for what I can check to see fix the parts not working?

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

I advice you to test the connectivity and debug even further your TV MQTT broker, through this: https://github.com/tiagofreire-pt/Home_Assistant_Hisense_TV#further-debugging-or-exploring-the-mqtt-broker-inside-the-tv

The MQTT Explorer may help on that.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Hi @tiagofreire-pt thanks for suggesting that, it was one of the first things I tried before I started this process; so I didn’t accidentally waste my time. I can connect perfectly with MQTT Explorer and see all commands sent and received (with the TLS enabled). This is also where I have double checked all my publish and subscribe commands are correct and where I am now using the MAC address it provides in those commands.

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

I suggest you another two things:

  • Pair you TV with another android smart phone and use its mac address;
  • Check if there is any firmware upgrade for your TV, as these devices tend to have some bugs here and there...

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

@tiagofreire-pt sorry for the long delay on this one, I have not had much time to fiddle around with this lately. I have just paired an android tablet I own to the TV and most functionality is now working. All buttons are now working on the lovelace remote, except for the on/off (power) button and I still do not have a correct feedback on the 'power state' of the TV; it just says it is always off.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Maybe I Have placed my switch and sensor in the wrong area of the config file?
image

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

Make sure you have an entity called or similarly called device_tracker.hisense_tv, created by the HA itself, through an integration of device tracking. Such as, device presence detection through your router, ping, nmap, etc.

This entity is the one responsible to define the switch state and its feedback after some time, related to the TV on and off states.

Check here if you own router is 100% compatible with one specific integration or you could use ping ICMP or nmap tracker instead: https://www.home-assistant.io/integrations/#presence-detection

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Yeah I do not see device_tracker.hisense_tv in my entities. I also do not see the brand of my router under presence detection on that website; I have a D-LINK DIR-882. Is ping ICMP or nmap tracker something I need to set up on my router or something that is set up in HA?

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

On your home assistant instance, in the file configuration.yaml:

device_tracker:
  - platform: ping
    count: 20
    scan_interval: 60
    hosts:
      hisense_tv: YOUR_TV_IP_ADDRESS_HERE
      other_random_cell_phone_or_whatever_device: its_ip_over_here

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

I just gave that a go and now have a second 'Hisense_TV' that says 'away', I then added another device to make sure it works (Android_Tablet) and that is showing 'home'. I wonder now if this is an issue with the fact that I cannot even ping it from command prompt in windows? I figured this was a problem with the encrypted MQTT used? Or should I be able to ping the TV from command prompt? Here is what I see now in HA:

image

from home_assistant_hisense_tv.

tiagofreire-pt avatar tiagofreire-pt commented on July 20, 2024

The device state may take several minutes, as the TV seems to boot/awake some software after turning it on.

It may help a little bit if the TV is connected through ethernet, as its wifi adapter seems to be turned off with the TV and takes a little bit to connect again to the wifi access point.

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

Sadly a few minutes did not do the trick and using the ethernet cable also did not change anything...

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

@carvan thanks for the information and I have also come to the realisation that the TV is not pingable without some work around like that. I am alongside this trying to work out a solution through shell scripts to use in Homebridge instead and the above will be quite handy. Are you able to provide me a link to where you found that just so I can read a bit more about it?

Also not knowing much MQTT, but do you think exposing the ping is something that is a software fix if I was able to harass Hisense enough to include in a firmware update? Or would that not be possible?

from home_assistant_hisense_tv.

mitch7391 avatar mitch7391 commented on July 20, 2024

No worries @tiagofreire-pt and thank you again for all the help!

from home_assistant_hisense_tv.

Related Issues (7)

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.