bk1285 / rpi_wordclock_for_homeassistant

Makes a rpi_wordclock available to homeassistant as light
GNU General Public License v3.0
3 stars 2 forks source link

update needed for HA 92.0> ? #1

Closed KleBoR closed 2 years ago

KleBoR commented 4 years ago

Hi, i just updated my HA and recognized that your module isnt working anymore :/

i tried to change the config a bit to fit the new changes, but it seems im not able to fix this :)

would it be possible for you to take a look at this?

thank you

outsidernl commented 4 years ago

Indeed, please update the plugin to work with the new light component.

joeduck commented 3 years ago

Same here. would be great if you could customize that.

Many thanks

bk1285 commented 3 years ago

Hi all, thanks for reporting!

I just opened #2

Can you give it a try and report back, if the integration works for you? ...in this case I'd merge the pull request.

Best, Bernd

joeduck commented 3 years ago

Hallo Bernd,

vielen Dank dass du dein Programm überarbeitest. Habe die Wordclock jetzt als Licht eingebunden bekommen.

Hierzu habe ich in HA in custom_components das Verzeichnis "rpi_wordclock" angelegt und die Datei light.py manuell reinkopiert. Die Config habe ich dann wie im Readme beschrieben bearbeitet.

Die Uhr taucht nun als Licht auf, die Farbtemperatur lässt sich regeln. Die Helligkeit und die RGB Farbe kann man aber nicht einstellen. Aus/einschalten geht leider auch nicht.

Grüße

bk1285 commented 3 years ago

Hi @joeduck,

Danke für's schnelle Feedback. Sollte jetzt mit den letzten Änderungen klappen. Die hängen jedoch vom neusten develop-branch der Wordclock ab: https://github.com/bk1285/rpi_wordclock/tree/develop

Grüße, Bernd

joeduck commented 3 years ago

Hallo Bernd,

vielen Dank für die prompte Änderungen. Habe die aktuelle rpi_wordclock DEV installiert und das aktuelle adddon für HA. Jetzt funktioniert:

Einschalten geht aber nicht, man muss den Slider hochziehen. Wenn ich die Helligekit über den Slider hochgezogen habe und über node-red über die API die Farbe ändere (nutze das für eine Raumluftanzeige) dann stürzt die Wortuhr ab. Wenn der Slider nicht bewegt wird, funktioniert es mit node-red wie vorher.

2021-01-12 18:14:01,747 - INFO: 192.168.178.21 - - [12/Jan/2021 18:14:01] "GET /api/color HTTP/1.1" 200 - 2021-01-12 18:14:03,640 - ERROR: Error in plugin time_default. 2021-01-12 18:14:03,641 - ERROR: PLEASE PROVIDE THE CURRENT SOFTWARE VERSION (GIT HASH), WHEN REPORTING THIS ERROR: v1.0.0-dev-23-ge866e82 2021-01-12 18:14:03,698 - DEBUG: STREAM 'IHDR' 16 13 2021-01-12 18:14:03,698 - DEBUG: STREAM 'bKGD' 41 6 2021-01-12 18:14:03,699 - DEBUG: 'bKGD' 41 6 (unknown) 2021-01-12 18:14:03,699 - DEBUG: STREAM 'pHYs' 59 9 2021-01-12 18:14:03,700 - DEBUG: STREAM 'tIME' 80 7 2021-01-12 18:14:03,700 - DEBUG: 'tIME' 80 7 (unknown) 2021-01-12 18:14:03,700 - DEBUG: STREAM 'tEXt' 99 25 2021-01-12 18:14:03,701 - DEBUG: STREAM 'IDAT' 136 64 Traceback (most recent call last): File "wordclock.py", line 187, in <module> word_clock.run() File "wordclock.py", line 152, in run self.runPlugin() File "wordclock.py", line 130, in runPlugin self.wcd.setImage(os.path.join(self.pathToGeneralIcons, 'error.png')) File "/home/pi/rpi_wordclock_dev/wordclock_tools/wordclock_display.py", line 205, in setImage self.show() File "/home/pi/rpi_wordclock_dev/wordclock_tools/wordclock_display.py", line 321, in show self.render_transition_step(self.transition_cache_curr) File "/home/pi/rpi_wordclock_dev/wordclock_tools/wordclock_display.py", line 287, in render_transition_step self.wcl.setColorBy2DCoordinates(self.strip, x, y, self.apply_brightness(transition_cache_step.matrix[x][y])) File "/home/pi/rpi_wordclock_dev/wordclock_tools/wiring.py", line 83, in setColorBy2DCoordinates strip.setPixelColor(self.wcl.getStripIndexFrom2D(x, y), color) File "/home/pi/rpi_wordclock_dev/wordclock_tools/wordclock_strip_neopixel.py", line 21, in setPixelColor super(wordclock_strip_neopixel, self).setPixelColor(index, neopixelcolor) File "build/bdist.linux-armv7l/egg/neopixel.py", line 118, in setPixelColor File "build/bdist.linux-armv7l/egg/neopixel.py", line 49, in __setitem__ OverflowError: in method 'ws2811_led_set', argument 3 of type 'uint32_t'

bk1285 commented 3 years ago

Hey @joeduck,

es geht doch nicht's über gewissenhafte beta-Tester :smiley: Danke für's reporten!

Mit dem master-branch dieses repos + develop-branch des wordclock repos https://github.com/bk1285/rpi_wordclock/tree/develop sollte jetzt alles laufen. Andernfalls gerne melden.. :grin:

Cheers, Bernd

joeduck commented 3 years ago

Morgen,

vielen Dank! Jetzt klappt es bis auf das einschalten. Habe folgenden Code eingefügt damit es funktioniert:

`
def turn_on(self, **kwargs): """ Instruct the light to turn on.

    You can skip the brightness part if your light does not support
    brightness control.
    """
    #Light:ON
    r = requests.post(self._api_endpoint + '/brightness' , json={"brightness": 150})
    self.log(r)

`

bk1285 commented 3 years ago

Hi @joeduck, hm... läuft bei mir inkl. Einschalten. Welche Version von HA nutzt du denn?

@KleBoR @outsidernl maybe you want to checkout latest master for testing. Please report back, in case the clock cannot be turned on via HAs software switch.

Best, Bernd

KleBoR commented 3 years ago

hi @bk1285 ,

tut mir leid das ich mich so spät erst zurück melde. Ich habe dein Plugin (aktueller master) mit den letzten 5-6 Versionen von Homeassistant ebenfalls getestet. Durch das setzen der Brightness auf 0 schaltet sich die Uhr bei mir komplett aus, sowie durch erneuten tab auch wieder ein. Kann das problem von @joeduck leider nicht nachvollziehen. (bin aber weiter am nachstellen..)

Kann also nur Positiv reporten =) Ein echt nettes feature wäre die Integration der verschiedenen Clock-Plugins in die HA integration.

Ansonsten vielen Dank!! Ich bleibe weiterhin am Ball um weiteres zu testen, sowie zu reporten falls ich doch noch den Fehler von @joeduck nachgestellt bekomme.. =)

Grüße

joeduck commented 3 years ago

o.k. Weiß nicht was ich falsch mache, tut mir leid. Bin auf der aktuellen Version von HA. Habe jetzt das Verzeichnis in custom_components gelöscht. Dann nochmal von vorn genau nach Anleitung:

"git clone https://github.com/bk1285/rpi_wordclock_for_homeassistant.git rpi_wordclock"

Dann ist aber im Verzeichnis custom_components die Struktur so: "/rpi_wordclock/rpi_wordclock". Dort ist dann die light.py. In der configuration.yaml so eingetragen wie in der Anöeitung. Aber beim Config prüfen kommt dann dass er die Integration nicht findet.

Seltsam.

KleBoR commented 3 years ago

@joeduck die struktur sollte wie folgt sein: " custom_components/rpi_wordclock/light.py " dann sollte alles funktionieren.

lg

joeduck commented 3 years ago

Hallo,

habe jetzt "self._off_brightness = 0" gesetzt, dann sind die LEDs aus wenn man ausschaltet.

KleBoR commented 3 years ago

ich denke da alles soweit funktioniert kann ich das ticket schliessen.. =) danke @bk1285

KleBoR commented 3 years ago

Hi Bernd,

habe festgestellt das mit der aktuellen Version core-2021.8.8 sich der Fehler wieder eingeschlilchen hat. (die light.rpi_wordclock integration wird nicht erkannt). wäre cool wenn du noch einmal ein Auge darauf wirfst sofern Zeit besteht =)

Danke Dir!

BlackCatCXIII commented 2 years ago

Moin @KleBoR ,

die Änderungen sind minimal, und du kannst sie auch von Hand schnell einpflegen. Es geht eigentlich um eine Versions-Nummer in der manifest.json, damit Home Assistant das Plugin läd. Und bei mir ging die Uhr nicht ganz aus, darum habe ich die Off-Helligkeit auf 0 gesetzt. Wenn du dir das ansehen willst geht das hier: https://github.com/bk1285/rpi_wordclock_for_homeassistant/pull/3

bk1285 commented 2 years ago

@KleBoR, please comment, if @BlackCatCXIII's changes resolve the issue.

Best, Bernd

KleBoR commented 2 years ago

hi @bk1285 , @BlackCatCXIII,

die Versionsnummer hatte ich bereits eingepflegt, jedoch scheint irgendetwas anderes nicht ganz korrekt gelaufen zu sein. Habe die Integration komplett entfernt und neu hinzugefügt - seitdem läuft sie.

Vielen Dank!!