En3rGy / 14100_Hue

Gira HS logic module to control Philips Hue
MIT License
7 stars 0 forks source link

all lights are switched on when putting 1 on #29

Closed charlez79 closed 1 month ago

charlez79 commented 1 year ago

When i put 1 light on, the other that is in the same group does the same after 1 sec. I'm not using the group id. When i put the same light out, the other stays on. Changing the color does not have the same issue. Only the put on is responding to that command.

En3rGy commented 1 year ago

I can not reproduce that behaviour. Can you give more insight? Is this still an issue with the current version?

charlez79 commented 1 year ago

Hi, you can close this topic. After rebooting the bridge the issue went away. Don't know what caused this in the fist place.

charlez79 commented 1 year ago

Running the latest version. Today the issue is back, will try to do some network tracing one of the days Could you re-open the issue?

charlez79 commented 1 year ago

I think the problem is related to the feedback. Central addresses made 2nd device turn on, removed those now. Now only feedback is wrong.

`

#TimeServiceFlags PrioSource AddressSource NameDestination AddressDestination NameHop CountTypeDPTInfo
607/09/2023 20:21:05,059from busLow1.1.65Tastsensor 3 comfort viervoudig F1000/1/30Licht Master Bedroom Bed Rechts Schakelen6GroupValue_Write $01 | On
617/09/2023 20:21:05,466from busHigh1.5.1Gira Homeserver0/1/33Licht Master Bedroom Bed Rechts Feedback Schakel5GroupValue_Write $01 | On
667/09/2023 20:21:06,394from busHigh1.5.1Gira Homeserver0/1/23Licht Master Bedroom Bed Links Feedback Schakel5GroupValue_Write $01 | On
687/09/2023 20:21:06,449from busHigh1.5.1Gira Homeserver0/1/24Licht Master Bedroom Bed Links Feedback Helderheid5GroupValue_Write $3D | 24%
697/09/2023 20:21:06,556from busHigh1.5.1Gira Homeserver0/1/34Licht Master Bedroom Bed Rechts Feedback Helderhei5GroupValue_Write $3D | 24%

`

Address 0/1/23 is feedback of 2nd device that is reporting ON while no command is given.

Could it be that the status is not filtered to the corresponding configured ID?

charlez79 commented 1 year ago

In your code you are looking for "on" in data stream to report the status of light/group. In my case i'm only turning 1 lamp on. The group will also report ON since 1 light of 2 in the group is ON. Should there not be a filter that only looks at the lamp status with ID of the lamp in stream instead of all "ON" statuses?

En3rGy commented 1 year ago

In line #147 of src/14100_Hue Group (14100).py all IDs not corresponding to the designated item are skipped, so the on check is only performed on those IDs.

But a valid ID is each ID correlating to a specific item. So e.g. item id, room id, group id ...

I don't know when which id will be triggered by the bridge.

Du you suggest a different behaviour?

charlez79 commented 1 year ago

I saw that. I need more insight on what data is sent back. I'll try to run the simulation one of the days on my pc. To see what is happening

charlez79 commented 1 year ago

i'm not able to get the simulator working, getting this error. Never worked with custom modules

Traceback (most recent call last): File "C:\tmp_fw_dir\HSL20_Framework\simulator.py", line 956, in File "C:\tmp_fw_dir\HSL20_Framework\simulator.py", line 824, in start File "C:\tmp_fw_dir\HSL20_Framework\simulator.py", line 374, in start File "C:\tmp_fw_dir\HSL20_Framework\simulator.py", line 428, in _init_logic File "", line 1, in File "Hue Group (14100)14100", line 464, in ImportError: No module named hue_lib.hue_item

En3rGy commented 1 year ago

Check out the readme.md to get info regarding the development environment. as soon a syou have set this up, you can run the unsit test in the ./tests directory an work with them thesting in your local environment.

charlez79 commented 1 year ago

Those tests i can run now. But i would like to test the module itself. Missing singleton module, it's not in the package.

File "", line 1, in File "Hue Group (14100)14100", line 468, in ImportError: No module named singleton

En3rGy commented 1 year ago

added the missing file

charlez79 commented 1 year ago

still not getting the simulation to work.

File "", line 1, in File "Hue Group (14100)14100", line 887, in File "Hue Group (14100)14100", line 505, in init NameError: global name 'random' is not defined

this code block is still causing issues, don't know why. When i remove the simulation starts, no errors, but nothing happens...

self.logger = logging.getLogger("{}".format(random.randint(0, 9999999)))

        # Create a custom logging level TRACE
        logging.addLevelName(TRACE, "TRACE")

        def trace(self, message, *args, **kws):
            if self.isEnabledFor(TRACE):
                self._log(TRACE, message, args, **kws)

        logging.Logger.trace = trace

        self.bridge = hue_bridge.HueBridge(self.logger)
        self.server = html_server.HtmlServer(self.logger)
        self.singleton = None
        self.eventstream_thread = threading.Thread()  # type: threading.Thread
        self.eventstream_keep_running = threading.Event()
        self.event_list = []
        self.msg_last = str()
        self.curr_bri = 0
        self.g_out_sbc = {}  # type: {int, object}
        self.debug = False  # type: bool
En3rGy commented 11 months ago

Todo:

En3rGy commented 11 months ago

2x call of switch on / off is triggered by an input on the logic module:

  1. https://github.com/En3rGy/14100_Hue/blob/40fdb2e489e0d74eacd7860c815ff4349b2277a0/src/14100_Hue%20Group%20(14100).py#L434
  2. https://github.com/En3rGy/14100_Hue/blob/40fdb2e489e0d74eacd7860c815ff4349b2277a0/src/14100_Hue%20Group%20(14100).py#L463

Receiving messages of hue bridge results in https://github.com/En3rGy/14100_Hue/blob/40fdb2e489e0d74eacd7860c815ff4349b2277a0/src/14100_Hue%20Group%20(14100).py#L114 and triggers output signals only.

The observed behavior seems to not be the result of the logic module but the surrounding logic.

En3rGy commented 11 months ago

Seems like the light/switch does not turn on but the status output states that the light is on.

charlez79 commented 9 months ago

Installed v3.10 and fist test seems to fixed the problem. Keep you updated