zvldz / ha_custom_filters Goto Github PK
View Code? Open in Web Editor NEWCustom filters for Home Assistant
License: Other
Custom filters for Home Assistant
License: Other
Your license file is empty, perhaps use MIT?
Came here from https://github.com/TheLastProject/lovelace-valetudo-map-card
where should I put hacs.json ?
How would I install this with HACS ? Search for custom filters in HACS did not yield anything.
Home Assistant version: 0.118.3
ha_custom_filters version: 3c805de
I'm running into an odd problem with this component. It works fine during normal use, but occasionally trips up my github actions based configuration checking run with the following error:
Failed config
sensor.mqtt:
- Invalid config for [sensor.mqtt]: invalid template (TemplateAssertionError: no filter named 'decode_valetudo_map') for dictionary value @ data['json_attributes_template']. Got "{% if 'class' in value[1:10] %} {{ value }} {% else %} {{ value | decode_valetudo_map }} {% endif %}". (See ?, line ?).
- platform: mqtt
json_attributes_template: {% if 'class' in value[1:10] %} {{ value }} {% else %} {{ value | decode_valetudo_map }} {% endif %}
json_attributes_topic: valetudo/downstairs-rockrobo/map_data
name: downstairs_roborock_map
state_topic: valetudo/downstairs-rockrobo/state
value_template: OK
- Invalid config for [sensor.mqtt]: invalid template (TemplateAssertionError: no filter named 'decode_valetudo_map') for dictionary value @ data['json_attributes_template']. Got "{% if 'class' in value[1:10] %} {{ value }} {% else %} {{ value | decode_valetudo_map }} {% endif %}". (See ?, line ?).
- platform: mqtt
json_attributes_template: {% if 'class' in value[1:10] %} {{ value }} {% else %} {{ value | decode_valetudo_map }} {% endif %}
json_attributes_topic: valetudo/upstairs-rockrobo/map_data
name: upstairs_roborock_map
state_topic: valetudo/upstairs-rockrobo/state
value_template: OK
My best guess is that this is because the custom filters component is likely not getting installed before the mqtt sensors are processed.
Any suggestions on resolving this?
I'm having some trouble getting this to work.
I've added via Hacs. Testing in dev tools, the functions work as globals, but not as filters.
Works: {{ get_type('foo bar baz') }}
Fails: {{ 'foo bar baz' | get_type }}
, error: TemplateAssertionError: No filter named 'get_type'.
Any ideas?
This is with Home Assistant installed on a raspberry pi.
I attempted to open a pull request, but unfortunately, the associated feature was closed.
Consequently, I have initiated a new filter. It would be highly beneficial to incorporate a filter supporting the bidi algorithm, particularly for the display of RTL text (predominantly for Arabic and Hebrew).
The pertinent Python package is 'python-bidi,' housing the 'get_display' function within the 'bidi.algorithm' module.
For example:
Input string = שלום
Out = םולש
Hi,
after updating to 2023.3, I have a big issue : I cannot use this integration :
I installed a development environment in vscode + docker desktop, and I can reproduce this behaviour ... sort of.
I only need to restart the debug environment ( stop + F5 or click this icon :
)
and One time, it will work, next start it will not work ... on my production env (rpi4) it never works anymore. Seems to be a startup order issue but I cannot yet understand how to fix it, would you mind looking at it please ?
Hey i found your costume Filter and i want you to ask if you could help me.
I need to convert a hex string in Home Assistant to Base64. I tried to modify yout filter but no success.
Would be nice if you could help me.
For example: My Hex String is 01000258 and it should be "AQACWA==".
I tried:
def b64encode(string):
data = string.encode("UTF-8")
return base64.b64encode(data)
but no success.
Would be nice if you could help me.
Tanks :)
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.