deermaximum / qr-code-generator Goto Github PK
View Code? Open in Web Editor NEWCustom Home Assistant integration to create a camera that displays a custom QR-Code
License: MIT License
Custom Home Assistant integration to create a camera that displays a custom QR-Code
License: MIT License
The latest version is compatible from 2023.11.0 upwards only, but could still be installed inadvertently.
This can be avoided by using the "homeassistant" key in hacs.json which defines the minimum version.
I suggest to add this key to the hacs.json file.
A clear and concise description of what the bug is.
Add your logs here.
It just doesn't work when I enter the content below
WIFI:T:WPA;S:guest;P:{{ states('input_text.guest_wifi_password')}};H:0
The error message
Logger: homeassistant.components.camera
Source: custom_components/qr_generator/camera.py:120
Integration: Camera (documentation, issues)
First occurred: 8:05:39 PM (4 occurrences)
Last logged: 8:07:16 PM
Error adding entities for domain camera with platform qr_generator
Error while setting up qr_generator platform for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 691, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/qr_generator/camera.py", line 92, in async_added_to_hass
self._refresh()
File "/config/custom_components/qr_generator/camera.py", line 120, in _refresh
code = pyqrcode.create(
File "/usr/local/lib/python3.10/site-packages/pyqrcode/__init__.py", line 111, in create
return QRCode(content, error, version, mode, encoding)
File "/usr/local/lib/python3.10/site-packages/pyqrcode/__init__.py", line 161, in __init__
self.data = content.encode(self.encoding)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u201d' in position 13: ordinal not in range(256)
Hi, I'm just wondering is this can help me achieve such a scenario:
I have working face recognition using my door camera, and want to unlock the doors with it, but i am aware of false positive, so my idea is to generate one minute valid qr-code and send it to recognized person phone. Then person have to scan it using my door camera.
I believe that generated tag have to be added to home assistant tags, and removed on scan or validity ends
Is qr-code-generator a way to go ?
Not working on Home Assistant 2022.12.0b0.
v1.0.1
Can not set up QR code generator integration.
Logger: homeassistant.util.package
Source: util/package.py:98
First occurred: 9:14:44 AM (3 occurrences)
Last logged: 9:14:47 AM
Unable to install package pillow==9.2.0: ERROR: Cannot install pillow==9.2.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts [notice] A new release of pip available: 22.3 -> 22.3.1 [notice] To update, run: pip install --upgrade pip
Logger: homeassistant.setup
Source: setup.py:202
First occurred: 9:14:47 AM (1 occurrences)
Last logged: 9:14:47 AM
Setup failed for custom integration qr_generator: Requirements for qr_generator not found: ['pillow==9.2.0'].
websocket_api script: Error executing script. Error for call_service at pos 1: Could not find entity image.qr3 from integration
qr_generator
websocket_api script: Error executing script. Error for call_service at pos 1: Could not find entity image.qr_oborudovaniia from integration qr_generator
websocket_api script: Error executing script. Error for call_service at pos 1: Could not find entity image.otp from integration qr_generator
I would like to send generated QRCodes as attachment in notifications, and it seems the image entity is not appropiate for that.
Therefore, I think a service or configuration option to download current image (much like the camera.snapshot service) will be necessary.
Thanks!
Hi,
could you add a HowTo (Install the component) and some examples how to add a QR-code to the UI.
The start would be much easier
thanks a lot
Edit: please ignore this issue, just saw the closed issues.
Cheers
Is your feature request related to a problem? Please describe.
Recommend updating your ReadMe.MD with am example to generate your guest wifi password.
Describe the solution you'd like
In the "content" field add if you want display guest wifi:
WIFI:T:WPA2;S:MyNetworkName;P:ThisIsMyPassword;H:true;
Describe alternatives you've considered
Ultimately, in long run the user will want store secret in a secrets manager like hashi vault or at minimum base64 or call it from CSP secret . However, for home network and lockdown Home assistant little risk.
I know it's an early release, would it be possible to add an example into the ReadMe.md for configuration?
Much Appreciated for those that don't python that much!
I'm receiving this error after updating Home Assistant.
Setup failed for custom integration qr_generator: Requirements for qr_generator not found: ['pillow==9.5.0'].
Home Assistant 2023.4.5
Supervisor 2023.04.0
Operating System 10.0
Frontend 20230411.1 - latest
Home Assistant 2023.7 introduces a new image entity. This seems more applicable since it does not require a continuous stream. A qr code is exactly one of the examples. There are already some platforms that use it: https://rc.home-assistant.io/blog/2023/06/28/release-20237/#image-entities
It would be great if you could provide a working dynamic template sample.
Thanks in advance!
Logger: homeassistant.setup
Source: setup.py:185
First occurred: 00:08:32 (1 occurrences)
Last logged: 00:08:32
Setup failed for custom integration qr_generator: Requirements for qr_generator not found: ['pillow==10.0.1'].
Not working on Home Assistant 2023.02.0b0.
v1.0.2
Can not set up QR code generator integration.
Logger: homeassistant.util.package
Source: util/package.py:100
First occurred: 11:17:03 PM (3 occurrences)
Last logged: 11:17:19 PM
Unable to install package pillow==9.3.0: ERROR: Cannot install pillow==9.3.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts [notice] A new release of pip available: 22.3 -> 22.3.1 [notice] To update, run: pip install --upgrade pip
Logger: homeassistant.setup
Source: setup.py:205
First occurred: 11:17:19 PM (1 occurrences)
Last logged: 11:17:19 PM
Setup failed for custom integration qr_generator: Requirements for qr_generator not found: ['pillow==9.3.0'].
Is your feature request related to a problem? Please describe.
Reading through the README.md I am unable to understand how I am supposed to populate the template in an automated way.
The README.md currently contains the following example:
For wifi access with template
Name: My wifi access
Content: WIFI:T:WPA2;S:MyNetworkName;P:{{states("input_text.wlan_password")}};H:true;
but the README.md does not describe how {{states("input_text.wlan_password")}}
is supposed to be sent to the integration to achieve the dynamic update of the QR Code.
Describe the solution you'd like
I would like an example, showing an automation in Home Assistant that update the QR Code image by sending new data to its template .
Unable to install package pillow==9.3.0: ERROR: Cannot install pillow==9.3.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
same problem as #24 tries to solve
v.2.0.1
Can't generate the png file
Getting an error that 'png' python module is missing. I am using Home Assistant from the offical docker image. I can install the png module with a command in the Dockerfile but don't see any requirements in your readme.
Logger: homeassistant.components.image
Source: custom_components/qr_generator/image.py:126
Integration: Image (documentation, issues)
First occurred: 10:37:42 PM (8 occurrences)
Last logged: 10:41:03 PM
Error adding entities for domain image with platform qr_generator
Error while setting up qr_generator platform for image
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1003, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/qr_generator/image.py", line 94, in async_added_to_hass
await self._refresh()
File "/config/custom_components/qr_generator/image.py", line 126, in _refresh
code.png(
File "/usr/local/lib/python3.11/site-packages/pyqrcode/__init__.py", line 462, in png
builder._png(self.code, self.version, file, scale,
File "/usr/local/lib/python3.11/site-packages/pyqrcode/builder.py", line 1266, in _png
import png
ModuleNotFoundError: No module named 'png'
2.1.8
2024.5.0b0
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:190
First occurred: 22:12:52 (5 occurrences)
Last logged: 22:15:23
Detected that custom integration 'qr_generator' calls `async_track_state_change` instead of `async_track_state_change_event` which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/qr_generator/image.py, line 108: async_track_state_change(, please create a bug report at https://github.com/DeerMaximum/QR-Code-Generator/issues
Logger: homeassistant.setup
Source: setup.py:185
First occurred: 21:54:28 (1 occurrences)
Last logged: 21:54:28
Setup failed for custom integration qr_generator: Requirements for qr_generator not found: ['pillow==10.0.0'].
Using recommended install method, HACS repo on v1.0.3. After Home instant reboot and integration added the wizard spins with no success.
Only fix was to use v1.0.2
None
Hi, I'm getting the following error after downloading your integration using HACS.
Error
Config flow could not be loaded: undefined
Am I doing something wrong?
Hi,
Is it possible to add a small logo at the center of the QR code when generating?
Just suggesting, thanks for the great project!
First of all, thank you for such simple and nice integration!
V.2.0.0
In README.md file there is "Details" section which contains "Options" and "Attributes".
I've found attributes in images entity. But I couldn't find "Options". Where can I set them? As I understand, I can't just change attribute of image, and then it will be re-rendered..
As I guessed, those "Options" can be set while creating image entity on page of "QR-Code Generator" integration. And there is an "Advanced settings" checkbox, but clicking on it does nothing. Here are screenshots with checked and unchecked "Advanced settings" checkbox:
Any related logs (related because of "qr_generator:1" link) , I've found in browser console is here
Google Chrome. latest for now: Version 114.0.5735.198 (Official Build) (x86_64)
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "mini-graph-card" has already been used with this registry
qr_generator:1 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "button-card-action-handler" has already been used with this registry
qr_generator:1 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "my-slider" has already been used with this registry
qr_generator:1 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "light-entity-card-editor" has already been used with this registry
qr_generator:1 Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "auto-entities-editor" has already been used with this registry
And logs from home assistant:
Home Assistant 2023.7.1
Supervisor 2023.07.1
Operating System 10.3
Frontend 20230705.1 - latest
2023-07-11 11:33:36.227 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration qr_generator which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-11 11:33:58.858 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'media_source', 'stt', 'map', 'file_upload', 'script', 'person', 'homeassistant_alerts', 'mobile_app', 'co2signal', 'auth', 'schedule', 'template', 'input_datetime', 'fully_kiosk', 'config', 'sensor', 'energy', 'input_boolean', 'samsungtv_smart', 'stream', 'panel_custom', 'input_number', 'openweathermap', 'dlna_dmr', 'esphome', 'persistent_notification', 'device_automation', 'hardware', 'xiaomi_miio', 'switch_as_x', 'mqtt', 'ffmpeg', 'upnp', 'default_config', 'image_upload', 'application_credentials', 'system_health', 'history', 'timer', 'assist_pipeline', 'wyoming', 'search', 'speedtestdotnet', 'browser_mod', 'blueprint', 'zone', 'trace', 'group', 'radio_browser', 'onboarding', 'homekit', 'repairs', 'localtuya', 'tag', 'hacs', 'automation', 'met', 'scene', 'input_select', 'sun', 'switch', 'counter', 'ui_lovelace_minimalist', 'utility_meter', 'input_button', 'tts', 'diagnostics', 'conversation', 'logbook', 'input_text', 'lovelace', 'qr_generator', 'my', 'analytics', 'samsungtv'}
2023-07-11 11:34:04.567 INFO (MainThread) [homeassistant.setup] Setting up qr_generator
2023-07-11 11:34:04.568 INFO (MainThread) [homeassistant.setup] Setup of domain qr_generator took 0.0 seconds
2023-07-11 11:34:07.736 INFO (MainThread) [homeassistant.components.image] Setting up image.qr_generator
2023-07-11 11:34:07.805 DEBUG (MainThread) [custom_components.qr_generator] Print "Test wifi" with: WIFI:S:changed NAME;T:WPA;P:some text;;
2023-07-11 11:36:26.040 ERROR (MainThread) [frontend.js.latest.202307051] https://fakehainstanceaddress/config/integrations/integration/qr_generator:0:0 Uncaught
2023-07-11 11:36:26.081 ERROR (MainThread) [frontend.js.latest.202307051] https://fakehainstanceaddress/config/integrations/integration/qr_generator:0:0 Uncaught
2023-07-11 11:36:26.084 ERROR (MainThread) [frontend.js.latest.202307051] https://fakehainstanceaddress/config/integrations/integration/qr_generator:0:0 Uncaught
2023-07-11 11:36:26.192 ERROR (MainThread) [frontend.js.latest.202307051] https://fakehainstanceaddress/config/integrations/integration/qr_generator:0:0 Uncaught
2023-07-11 11:36:26.267 ERROR (MainThread) [frontend.js.latest.202307051] https://fakehainstanceaddress/config/integrations/integration/qr_generator:0:0 Uncaught
2023-07-11 11:37:20.041 INFO (MainThread) [homeassistant.components.image] Setting up image.qr_generator
2023-07-11 11:37:20.046 DEBUG (MainThread) [custom_components.qr_generator] Print "Test wifi" with: WIFI:S:changed NAME;T:WPA;P:some text;;
They just bumped the Pillow version in beta 8/9. The HA release from tonight will break this integration.
Getting "Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble"
upon trying to add the custom component
version 2.1.5
2.0.0
Component not running because of dependency problem
Logger: homeassistant.util.package
Source: util/package.py:107
First occurred: 05:49:01 (3 occurrences)
Last logged: 05:49:04
Unable to install package pillow==9.5.0: ERROR: Cannot install pillow==9.5.0 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.