Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all lights are switched on when putting 1 on #29

Open
charlez79 opened this issue Jul 21, 2023 · 16 comments
Open

all lights are switched on when putting 1 on #29

charlez79 opened this issue Jul 21, 2023 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@charlez79
Copy link

charlez79 commented Jul 21, 2023

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.

@charlez79 charlez79 changed the title lights in group are all switched on when putting 1 on all lights are switched on when putting 1 on Jul 21, 2023
@En3rGy En3rGy self-assigned this Jul 21, 2023
@En3rGy
Copy link
Owner

En3rGy commented Sep 5, 2023

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

@charlez79
Copy link
Author

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

@En3rGy En3rGy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2023
@charlez79
Copy link
Author

charlez79 commented Sep 7, 2023

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
Copy link
Author

charlez79 commented Sep 7, 2023

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?

@En3rGy En3rGy reopened this Sep 11, 2023
@charlez79
Copy link
Author

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
Copy link
Owner

En3rGy commented Nov 1, 2023

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
Copy link
Author

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
Copy link
Author

charlez79 commented Nov 3, 2023

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
Copy link
Owner

En3rGy commented Nov 5, 2023

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
Copy link
Author

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
Copy link
Owner

En3rGy commented Nov 6, 2023

added the missing file

@charlez79
Copy link
Author

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
Copy link
Owner

En3rGy commented Dec 27, 2023

Todo:

  • Switch a light in a group via Hue App.
  • Record received messages from bridge
  • Check code regarding correlation of IDs, or set vs. get

@En3rGy
Copy link
Owner

En3rGy commented Dec 28, 2023

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

  1. device.set_on(ip, key, bool(value))
  2. device.set_on(ip, key, True)

Receiving messages of hue bridge results in

def process_json(self, msg):
and triggers output signals only.

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

@En3rGy
Copy link
Owner

En3rGy commented Dec 28, 2023

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

En3rGy added a commit that referenced this issue Dec 29, 2023
@En3rGy En3rGy added the bug Something isn't working label Jan 6, 2024
@charlez79
Copy link
Author

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

En3rGy added a commit that referenced this issue Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants