Wizzard72 / Domoticz-Unifi-Presence

GNU General Public License v3.0
5 stars 7 forks source link

Device shows as 'off' but actually 'on' #23

Open Yoiks opened 3 years ago

Yoiks commented 3 years ago

Hi, great plugin - thanks for making it available!

Quick question ...

Although the device status is 'on' in the Domoticz logs, it is showing as 'off' in the Domoticz panel - is that expected behaviour? It doesn't affect the script logic, but it would be nice to visually see that the device is present on the network.

image

image

image

Running Domoticz and Unifi in docker containers on Ubuntu 20.04.

Domoticz Version: 2021.1 (build 13628)

Unifi 6.4.54 (jacobalberty/unifi docker image)

Wizzard72 commented 2 years ago

Remove all of the devices, disable the plugin and then enable the plugin. Maybe that helps

5bomen commented 2 years ago

I have the same issue where I use the plug-in to detect the status of my TV. The distinctive situation here is that the TV is on a wired connection behind a Unifi Switch. Could this be the cause of the misrepresentation? Let me know if I can help debugging this.

Wizzard72 commented 2 years ago

The plugin doesn't detect and process wired devices.

5bomen commented 2 years ago

Ah, that is a bummer. Can I put in a feature request? Or is this very hard to code?

5bomen commented 2 years ago

Ah, that is a bummer. Can I put in a feature request? Or is this very hard to code?

I guess it is as simple as removing the check on "is_wired" in the request_online_phones function?

Wizzard72 commented 2 years ago

If you don't use the plugin for the detection of phones, then you can remove the is_wired. But if you use it also for phones than it can take a long time before a phone device is turned off. This because the output of the API turns the is_wired to true. This was a few unifi versions ago. So maybe they have solved it.

Wizzard72 commented 2 years ago

What is your use case for detecting the TV?

5bomen commented 2 years ago

What is your use case for detecting the TV?

My amplifier sometimes doesn't switch off when the TV is switched off (even though it should). So then the amplifier stays on all night comsuming a lof of energy. I want to trigger a script for switching it off when the TV is off and the master selector of the amplifier is set to TV.

Wizzard72 commented 2 years ago

Aha, ilI do the same, but i do it with a powerstrip meter, so if it's under a certain Watts then it power off.

5bomen commented 2 years ago

Aha, ilI do the same, but i do it with a powerstrip meter, so if it's under a certain Watts then it power off.

Yes, I recognize the solution. But it is not smart enough for my situation. I could just be listening to the radio or Spotify over my sound system - in that case the amplifier should not be switched off. The amplifier should only be switched of if the input selector is on TV input and the TV is off, not if any of the other inputs are selected, or if the TV is switched on.

Wizzard72 commented 2 years ago

If my amp is in standby it uses about 30 Watts. If its on about 50 Watts. So that is easy. There are for Denon/Marantz and I think Onkyo plugins for domoticz. My Onkyo is too old :-( But I'm in the market for a new one. Do you have such a plugin running on your domoticz?

5bomen commented 2 years ago

Yes I own a Onkyo TX-NR686. I use the Onkyo AV receiver (LAN) plugin.