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

Not able to find versions of files #9

Open
ofirda opened this issue Dec 28, 2022 · 11 comments
Open

Not able to find versions of files #9

ofirda opened this issue Dec 28, 2022 · 11 comments

Comments

@ofirda
Copy link

ofirda commented Dec 28, 2022

First - thank you for the development @tikismoke , I am left over with over 20 devices running on PLC and this is one of the last few items left on my HA list :)

I had an issue with the manifest file, it missed the version, so I added it, but now I have the issue of unmatched versions of pyserial and pyudev

{ "domain": "plcbus", "name": "Plcbus integration", "version": "0.0.2", "documentation": "https://github.com/tikismoke/home-assistant-plcbus", "dependencies": [], "codeowners": ["@Tikismoke"], "requirements": [ "pyserial==3.4", "pyudev==0.22.0" ] }

Unable to install package pyserial==3.4: ERROR: Cannot install pyserial==3.4 because these package versions have conflicting dependencies.

Unable to install package pyudev==0.22.0: ERROR: Cannot install pyudev==0.22.0 because these package versions have conflicting dependencies.

Any idea how I get these versions into my HA setup?

I am running HAOS on windows, using VirtualBox, I can access the HA CLI, I am not sure how to install these python files to start my PLC USB device and therefore the rest of the PLC clients.

@tikismoke
Copy link
Owner

Try to update dev by hand.
Sorry no more PLC us for me.

PR will be welcome for next if you succeed 😉

@ofirda
Copy link
Author

ofirda commented Dec 28, 2022

Thanks @tikismoke I have read you dismissed it already (you did right ;-))
What do you mean "update dev by hand" - download / install the version you were working with? can this be done via the HA UI by running a python script with a specific command?

@tikismoke
Copy link
Owner

Pip install upgrade pyudev and pyserial, look version and update manifest/dependency.

@ofirda
Copy link
Author

ofirda commented Dec 28, 2022

Thanks, I assumed that, just cant run PIP (or any python command) on the Home Assistant OS (running as an image on VirtualBox linux VM)
Therefore I cant even start to dev by hand
Would be happy to find some reference to handle this

@ofirda
Copy link
Author

ofirda commented Dec 31, 2022

@tikismoke I am happy to say that you made me challenge myself :-) and get it working!! Thank you

I had to do few things like (for the sake of others)
(1) change SwitchDevice to SwitchEntity (I need to read more on how I can push that to Git)
(2) open Com4 on VirtualBox and use the Device Host connection
(3) Use the device device: "/dev/ttyS3" (it didn't find it on USB)
(4) install pydev and pyserial and remove their version number from the manifest

I am left with 2 open issues, hoping to resolve / help

() How to poll the status of the device? when someone switched the physical light button it goes out of sync (in HomeSeer there was a "poll" function that took care of the sync)
(
) The second time I ran it I got this error: Platform plcbus does not generate unique IDs. ID PlcbusSwitch_FF_A3 already exists - ignoring switch.plcbusswitch_ff_a3
Does it mean that I should remove the switch now from configuraiton.yaml as it was all found?

(*)BTW - even though I put just 4 units [A1, A2, A3, A4] for some reason all my units were found, is that ok?

3
4

@ofirda
Copy link
Author

ofirda commented Jan 2, 2023

Found the answers
polling is done every minute
no need to add unit codes, just house is enough (make sure to delete old entries in entities beforehand)
managed to do it via USB0, need to install vbox extensions for that

Thanks @tikismoke for amazing work!

@ofirda ofirda closed this as completed Jan 2, 2023
@tikismoke
Copy link
Owner

Found the answers polling is done every minute no need to add unit codes, just house is enough (make sure to delete old entries in entities beforehand) managed to do it via USB0, need to install vbox extensions for that

Thanks @tikismoke for amazing work!

Could you make a PullRequest on GitHub to solve dependency issue?

@tikismoke
Copy link
Owner

tikismoke commented Jan 2, 2023

Keep opens since it need to be done in code

@tikismoke tikismoke reopened this Jan 2, 2023
@ofirda
Copy link
Author

ofirda commented Jan 3, 2023

OK @tikismoke I need to do this (never tried before)
BTW - if I recall correctly, when I had this in HomeSeer then polling was just 1 signal across the house and it could interpret the status of all devices of the house
Here the device is sending status request per device and therefor every minute you hear ~20 bzzzz from the serial adapter its annoying :-(
Do you guys have it the same?

@tikismoke
Copy link
Owner

@ofirda indeed. I had to have only 5/6 device and my adapter was hide under the stairs near my Dell server so never eat it more thant that but I can understand it's annoying in call environment.
If I remember I've already add this in the Todo. But as I could no more test anything I will not do it.
https://github.com/tikismoke/home-assistant-plcbus/projects/1#card-38017647
But it's mark as done.... So do no more remember what is don or not.

@ofirda
Copy link
Author

ofirda commented Jan 3, 2023

It does look like you did that in code, but I think I am missing something, you are using a parameter called housecode, which isn't defined in configuraiton.yaml (I only have user_code as "FF" in my case, my house code BTW is "A")

The PLCBUS interface https://en.wikipedia.org/wiki/PLCBUS does mention that its needed for the address, do you think it should it be defined in the config as well?

the code is -

@property def should_poll(self): """No need to poll. entity update is done by get_all_on_id_pulse.""" return False

and then

`def get_all_on_id(self, housecode, usercode):
'''
Fastpoll the housecode and return every on plugins
@param usercode : User code of item (must be 'H' syntax between 0 to
F) Without device index
@param housecode : one or more housecodes
'''
onlist = []
self._valid_house(housecode)
if (len(housecode)>1):
_LOGGER.debug("housecode length >1 keep only first characters")
housecode = housecode[0]

    self.send("GET_ALL_ON_ID_PULSE", housecode + "1", usercode)
    response = self._ser_handler.get_from_answer_queue()
    if(response):
        _LOGGER.debug ("Hoora response received", response)
        data = int(response[10:14], 16)
        for i in range(0, 16):
            if data >> i & 1:
                onlist.append(housecode + str(self._unitcodes[i]))
    _LOGGER.debug ("on : %s", onlist)
    return onlist

`

@tikismoke tikismoke reopened this Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants