Home Assistant plugin updated for Python 3

Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

FlyingDiver wrote:Also, please enter this in a Terminal window and post the results:

Code: Select all

pip3 show websocket-client
leegorecki@AUTOMATION ~ % pip3 show websocket-client
WARNING: Package(s) not found: websocket-client
leegorecki@AUTOMATION ~ %
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

Wait, that can't be right. If you didn't have that library, the plugin would complain about the broken import.

Unless you have a different conflicting library.

Do

Code: Select all

which pip3
pip3 list
Then try forcing the correct library:

Code: Select all

pip3 install websocket-client
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

You're doing all this on the Indigo system, right?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

Code: Select all

leegorecki@AUTOMATION ~ % which pip3
pip3 list
/Library/Frameworks/Python.framework/Versions/3.10/bin/pip3
Package                                           Version
------------------------------------------------- ---------
aiofiles                                          23.1.0
aiohttp                                           3.8.5
aiosignal                                         1.3.1
aniso8601                                         9.0.1
anyio                                             3.6.2
astral                                            2.2
async-generator                                   1.10
async-timeout                                     4.0.2
asyncclick                                        8.1.3.4
attrs                                             23.1.0
bitarray                                          2.8.0
bleak                                             0.14.3
certifi                                           2022.12.7
cffi                                              1.15.1
chacha20poly1305-reuseable                        0.4.1
chardet                                           3.0.4
charset-normalizer                                3.2.0
click                                             8.1.3
cryptography                                      39.0.2
cycler                                            0.11.0
dictdiffer                                        0.9.0
dnspython                                         2.3.0
email-validator                                   1.1.3
Flask                                             2.0.3
Flask-Cors                                        3.0.10
Flask-Login                                       0.5.0
Flask-RESTful                                     0.3.9
Flask-WTF                                         1.0.0
fonttools                                         4.33.3
frozenlist                                        1.4.0
future                                            0.18.3
h11                                               0.14.0
httpcore                                          0.16.3
httptools                                         0.5.0
httpx                                             0.23.3
idna                                              3.4
ifaddr                                            0.2.0
importlib-metadata                                6.0.0
itsdangerous                                      2.1.2
janus                                             1.0.0
Jinja2                                            3.1.2
jsonify                                           0.5
kiwisolver                                        1.4.3
MarkupSafe                                        2.1.1
matplotlib                                        3.5.1
mediafile                                         0.12.0
miniaudio                                         1.59
multidict                                         6.0.4
mutagen                                           1.46.0
numpy                                             1.22.4
packaging                                         21.3
paho-mqtt                                         1.6.1
Pillow                                            9.1.1
pip                                               21.2.4
protobuf                                          4.23.4
pyatv                                             0.13.4
pycparser                                         2.21
pyobjc                                            8.4.1
pyobjc-core                                       8.4.1
pyobjc-framework-Accessibility                    8.4.1
pyobjc-framework-Accounts                         8.4.1
pyobjc-framework-AddressBook                      8.4.1
pyobjc-framework-AdServices                       8.4.1
pyobjc-framework-AdSupport                        8.4.1
pyobjc-framework-AppleScriptKit                   8.4.1
pyobjc-framework-AppleScriptObjC                  8.4.1
pyobjc-framework-ApplicationServices              8.4.1
pyobjc-framework-AppTrackingTransparency          8.4.1
pyobjc-framework-AudioVideoBridging               8.4.1
pyobjc-framework-AuthenticationServices           8.4.1
pyobjc-framework-AutomaticAssessmentConfiguration 8.4.1
pyobjc-framework-Automator                        8.4.1
pyobjc-framework-AVFoundation                     8.4.1
pyobjc-framework-AVKit                            8.4.1
pyobjc-framework-BusinessChat                     8.4.1
pyobjc-framework-CalendarStore                    8.4.1
pyobjc-framework-CallKit                          8.4.1
pyobjc-framework-CFNetwork                        8.4.1
pyobjc-framework-ClassKit                         8.4.1
pyobjc-framework-CloudKit                         8.4.1
pyobjc-framework-Cocoa                            8.4.1
pyobjc-framework-Collaboration                    8.4.1
pyobjc-framework-ColorSync                        8.4.1
pyobjc-framework-Contacts                         8.4.1
pyobjc-framework-ContactsUI                       8.4.1
pyobjc-framework-CoreAudio                        8.4.1
pyobjc-framework-CoreAudioKit                     8.4.1
pyobjc-framework-CoreBluetooth                    8.4.1
pyobjc-framework-CoreData                         8.4.1
pyobjc-framework-CoreHaptics                      8.4.1
pyobjc-framework-CoreLocation                     8.4.1
pyobjc-framework-CoreMedia                        8.4.1
pyobjc-framework-CoreMediaIO                      8.4.1
pyobjc-framework-CoreMIDI                         8.4.1
pyobjc-framework-CoreML                           8.4.1
pyobjc-framework-CoreMotion                       8.4.1
pyobjc-framework-CoreServices                     8.4.1
pyobjc-framework-CoreSpotlight                    8.4.1
pyobjc-framework-CoreText                         8.4.1
pyobjc-framework-CoreWLAN                         8.4.1
pyobjc-framework-CryptoTokenKit                   8.4.1
pyobjc-framework-DataDetection                    8.4.1
pyobjc-framework-DeviceCheck                      8.4.1
pyobjc-framework-DictionaryServices               8.4.1
pyobjc-framework-DiscRecording                    8.4.1
pyobjc-framework-DiscRecordingUI                  8.4.1
pyobjc-framework-DiskArbitration                  8.4.1
pyobjc-framework-DVDPlayback                      8.4.1
pyobjc-framework-EventKit                         8.4.1
pyobjc-framework-ExceptionHandling                8.4.1
pyobjc-framework-ExecutionPolicy                  8.4.1
pyobjc-framework-ExternalAccessory                8.4.1
pyobjc-framework-FileProvider                     8.4.1
pyobjc-framework-FileProviderUI                   8.4.1
pyobjc-framework-FinderSync                       8.4.1
pyobjc-framework-FSEvents                         8.4.1
pyobjc-framework-GameCenter                       8.4.1
pyobjc-framework-GameController                   8.4.1
pyobjc-framework-GameKit                          8.4.1
pyobjc-framework-GameplayKit                      8.4.1
pyobjc-framework-ImageCaptureCore                 8.4.1
pyobjc-framework-IMServicePlugIn                  8.4.1
pyobjc-framework-InputMethodKit                   8.4.1
pyobjc-framework-InstallerPlugins                 8.4.1
pyobjc-framework-InstantMessage                   8.4.1
pyobjc-framework-Intents                          8.4.1
pyobjc-framework-IntentsUI                        8.4.1
pyobjc-framework-IOSurface                        8.4.1
pyobjc-framework-iTunesLibrary                    8.4.1
pyobjc-framework-KernelManagement                 8.4.1
pyobjc-framework-LatentSemanticMapping            8.4.1
pyobjc-framework-LaunchServices                   8.4.1
pyobjc-framework-libdispatch                      8.4.1
pyobjc-framework-LinkPresentation                 8.4.1
pyobjc-framework-LocalAuthentication              8.4.1
pyobjc-framework-LocalAuthenticationEmbeddedUI    8.4.1
pyobjc-framework-MailKit                          8.4.1
pyobjc-framework-MapKit                           8.4.1
pyobjc-framework-MediaAccessibility               8.4.1
pyobjc-framework-MediaLibrary                     8.4.1
pyobjc-framework-MediaPlayer                      8.4.1
pyobjc-framework-MediaToolbox                     8.4.1
pyobjc-framework-Metal                            8.4.1
pyobjc-framework-MetalKit                         8.4.1
pyobjc-framework-MetalPerformanceShaders          8.4.1
pyobjc-framework-MetalPerformanceShadersGraph     8.4.1
pyobjc-framework-MetricKit                        8.4.1
pyobjc-framework-MLCompute                        8.4.1
pyobjc-framework-ModelIO                          8.4.1
pyobjc-framework-MultipeerConnectivity            8.4.1
pyobjc-framework-NaturalLanguage                  8.4.1
pyobjc-framework-NetFS                            8.4.1
pyobjc-framework-Network                          8.4.1
pyobjc-framework-NetworkExtension                 8.4.1
pyobjc-framework-NotificationCenter               8.4.1
pyobjc-framework-OpenDirectory                    8.4.1
pyobjc-framework-OSAKit                           8.4.1
pyobjc-framework-OSLog                            8.4.1
pyobjc-framework-PassKit                          8.4.1
pyobjc-framework-PencilKit                        8.4.1
pyobjc-framework-Photos                           8.4.1
pyobjc-framework-PhotosUI                         8.4.1
pyobjc-framework-PreferencePanes                  8.4.1
pyobjc-framework-PushKit                          8.4.1
pyobjc-framework-Quartz                           8.4.1
pyobjc-framework-QuickLookThumbnailing            8.4.1
pyobjc-framework-ReplayKit                        8.4.1
pyobjc-framework-SafariServices                   8.4.1
pyobjc-framework-SceneKit                         8.4.1
pyobjc-framework-ScreenCaptureKit                 8.4.1
pyobjc-framework-ScreenSaver                      8.4.1
pyobjc-framework-ScreenTime                       8.4.1
pyobjc-framework-ScriptingBridge                  8.4.1
pyobjc-framework-SearchKit                        8.4.1
pyobjc-framework-Security                         8.4.1
pyobjc-framework-SecurityFoundation               8.4.1
pyobjc-framework-SecurityInterface                8.4.1
pyobjc-framework-ServiceManagement                8.4.1
pyobjc-framework-ShazamKit                        8.4.1
pyobjc-framework-Social                           8.4.1
pyobjc-framework-SoundAnalysis                    8.4.1
pyobjc-framework-Speech                           8.4.1
pyobjc-framework-SpriteKit                        8.4.1
pyobjc-framework-StoreKit                         8.4.1
pyobjc-framework-SyncServices                     8.4.1
pyobjc-framework-SystemConfiguration              8.4.1
pyobjc-framework-SystemExtensions                 8.4.1
pyobjc-framework-UniformTypeIdentifiers           8.4.1
pyobjc-framework-UserNotifications                8.4.1
pyobjc-framework-UserNotificationsUI              8.4.1
pyobjc-framework-VideoSubscriberAccount           8.4.1
pyobjc-framework-VideoToolbox                     8.4.1
pyobjc-framework-Virtualization                   8.4.1
pyobjc-framework-Vision                           8.4.1
pyobjc-framework-WebKit                           8.4.1
pyparsing                                         3.0.9
python-dateutil                                   2.8.2
python-kasa                                       0.4.1
pytz                                              2022.7.1
PyYAML                                            6.0
requests                                          2.31.0
rfc3986                                           1.5.0
rgbxy                                             0.5
sanic                                             22.6.1
sanic-routing                                     22.3.0
sanic-session                                     0.8.0
scipy                                             1.8.0
setuptools                                        58.1.0
six                                               1.16.0
sniffio                                           1.3.0
srptools                                          1.0.1
typing_extensions                                 4.5.0
ujson                                             5.7.0
urllib3                                           1.24.3
uvloop                                            0.17.0
websockets                                        10.4
Werkzeug                                          2.0.3
ws4py                                             0.5.1
WTForms                                           3.0.1
yarl                                              1.9.2
yeelight                                          0.7.10
zeroconf                                          0.72.3
zipp                                              3.14.0
WARNING: You are using pip version 21.2.4; however, version 23.2.1 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m pip install --upgrade pip' command.
leegorecki@AUTOMATION ~ % 
[

quote="FlyingDiver"]Wait, that can't be right. If you didn't have that library, the plugin would complain about the broken import.

Unless you have a different conflicting library.

Do

Code: Select all

which pip3
pip3 list
Then try forcing the correct library:

Code: Select all

pip3 install websocket-client
[/quote]
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

I am indeed

FlyingDiver wrote:You're doing all this on the Indigo system, right?
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

im guessing I have got to upgrade pip?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

Wizard Sleeve wrote:im guessing I have got to upgrade pip?
No, you need to install websocket-client. It's not in the list that pip generated.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

Ok thanks that fixed it not sure how that happened but seems ok now. I had to delete all the associated devices and added them again to get them to work.

Many thanks

Lee
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

My guess, and it's just a guess, is that you were actually running the old Python2 plugin and accidentally updated to the new Python3 plugin. And somehow the message about needing to install the library got lost.

Either that, or some really weird voodoo happened that deleted the library.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

Ok this is running well now but one of the devices is not pulling correctly in to Indigo

I have a sensor device on my dishwasher (Home Connect) that reports the state of the dishwasher "Run/Standby/Aborting" but when I add it in to indigo it adds as a Value Sensor and no matter what's reporting in Home Assistant indigo reports a value of "0"
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

Use the plugin menu command to write the entity info to the log, then post it here.

Actually, don't do that. It's likely a wall of text. Instead, search in the log for the specific device you're talking about, and just post that section. It'll look something like this:

Code: Select all

        "front_foyer_occupancy": {
            "attributes": {
                "device_class": "occupancy",
                "device_id": "1",
                "friendly_name": "Front Foyer Occupancy"
            },
            "context": {
                "id": "01H8QWAXHAQQE4R19YQ58Y0JKK",
                "parent_id": null,
                "user_id": null
            },
            "entity_id": "binary_sensor.front_foyer_occupancy",
            "last_changed": "2023-08-26T02:56:24.618511+00:00",
            "last_updated": "2023-08-26T02:56:24.618511+00:00",
            "state": "off"
        },
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

Code: Select all

},
        "studio_kitchen_dishwasher_operation_state": {
            "attributes": {
                "friendly_name": "Studio Kitchen Dishwasher  Operation State",
                "icon": "mdi:state-machine"
            },
            "context": {
                "id": "01H8VJAF8HVNBFGC68JERRRCGN",
                "parent_id": null,
                "user_id": null
            },
            "entity_id": "sensor.studio_kitchen_dishwasher_operation_state",
            "last_changed": "2023-08-27T13:18:21.969290+00:00",
            "last_updated": "2023-08-27T13:18:21.969290+00:00",
            "state": "Ready"
That would suggest its reporting right but it still says 0 in the state on the device list.

Thanks
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

That's because "Ready" is not a valid value for an Indigo sensor device. I'm not sure that's actually valid for HomeAssistant, even though it's reporting it verbatim.

I'll have to figure out how to deal with this.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Home Assistant plugin updated for Python 3

Post by FlyingDiver »

https://github.com/FlyingDiver/Indigo-H ... g/2023.0.6

Also on the Plugin Store.

This release adds an "actual_state" state for all devices. This custom state is set to the actual state value reported by Home Assistant, with no conversions for Indigo devices.

The short form is that whatever Integration is creating that dishwasher state entity was (IMO) poorly implemented. First, I'm not sure this really should be a Sensor entity type, but I don't know enough about HA to know if there's a better type to use. In Indigo, this would be a "custom" device type and it could be handled appropriately.

You'll notice that the attributes of the entity (as reported in the log sample you provided) doesn't have a "device_class" entry. Without this, I can't do any custom processing of the state to try to conform it to an Indigo device. There's just nothing there to identify what kind of entity this is.

So if you want to monitor this device's status, you'll need to test or trigger on the custom state, not the sensor value.

Also, since I had to add the new state, you'll need to edit and save the device to get it to show up. Actually, you'll need to edit and save all your HAA devices, or put up with the error messages in the log.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Wizard Sleeve
Posts: 71
Joined: Mon Feb 11, 2008 6:18 am
Location: Berkshire, United Kingdom

Re: Home Assistant plugin updated for Python 3

Post by Wizard Sleeve »

Ok thanks ill have a mess with that shortly
Locked

Return to “Home Assistant Agent”