Giter Club home page Giter Club logo

ps_hassio_entities's Introduction

About

GitHub last commit

Hi, you'll find here some personal and spare time projects of mine.

Stats

Additional stats here

ps_hassio_entities's People

Contributors

pmazz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ps_hassio_entities's Issues

An unhandled error has occurred. 'NoneType' object is not callable

Trying to set the friendly name at an input_select does nor work.

Using:

service: python_script.hass_entities
data:      
  action: set_attributes
  entity_id: input_select.home
  attributes:
    friendly_name: "abcd"

throws

hass_entities error
An unhandled error has occurred.

'NoneType' object is not callable

dooing is directly in HASS works, but i need it in an automation!

Can I change the "name" attribute of a timer?

What is your question
I have successfully used your script to change states/attributes of items in my config. However, when I try to change the name attribute of a timer, it simply doesn't happen.

YAML configuration

# This is my automation:
  - service: python_script.hass_entities
    data:
      action: set_attributes
      entity_id: timer.boiler_viktors_office
      attributes:
        - name: "Currently"
# This is my lovelace item:
      - entity: timer.boiler_viktors_office
        name: Time remaining
        tap_action: none

# This is my timer:
boiler_viktors_office:

Screenshots
If applicable, add your screenshots here.

Version
What is the version of the script?
v1.1.0

Additional information
In the logs I didn't find anything obvious...

[BUG] Repository structure for v1.1.0 is not compliant with HACS

** Bug **
When adding this repository as a custom repository in HACS, the process fails with the message;
Repository structure for v1.1.0 is not compliant
(HACS version 1.24.5 - current)

To Reproduce
Attempt to add the repository to HACS as a custom repository
(Note, the repository is not found in the base HACS components list

Expected behavior
The repository is added to hacs

YAML configuration

# NA

Perform a calculation to set a (new) state

Hi there,

I recently discovered your very helpful script to set states and/or attributes. So, thanks a lot!!

I'm looking for a way to use this (or customized) script) to do a simple calculation to set the new state.
But, I'm an enthusiastic but not yet highly skilled HA user. ;-)

I have a sensor that counts the motions from a motion sensor:

sensor:

  • platform: history_stats
    name: Beweging Kidsroom
    entity_id: binary_sensor.kidsroom_motion_sensor
    state: 'on'
    type: count
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

But sometimes I have a fake count (in this case by restarting HA).
So in that case I like to correct this by subtracting the value by 1 (from the state (string value)) .
So the new state should be the value of sensor.beweging_kidsroom minus 1

Is that possible with (some change/addition to) your script ?

I tried things like:

service: python_script.hass_entities
data:
action: set_state
entity_id: sensor.beweging_kidsroom
state: {{ states.sensor.beweging_kidsroom.state | int -1 }}. # with and without quotes

But yet without luck. I also tried to replace the state by using another state (also with no luck)
..
state: {{ states.sensor.beweging_slaapkamer.state }}. # with and without quotes

Maybe you are willing to help me to solve my issue. Or maybe you have a tip or other idea how to solve it.

Thanks in advance for a reply.

Good luck!

Best Regards,

Nico

the script doesn't seem to run properly not catching the parameter "action"

I'm interested in using this script but I'm not succeeding, I always get the following error: [homeassistant.components.python_script.hass_entities.py] Required parameter 'action' is missing. with following HA script configuration. Can you give me a hint? Thank you.

YAML configuration

prova_python_script:
  alias: prova python script
  sequence:
  - service: python_script.hass_entities
    data:
      service_data:
        action: set_state
        entity_id: sensor.temperatura_piano_sopra
        state: 30
        log_enabled: true
  mode: single

Screenshots
If applicable, add your screenshots here.

Version
latest
Additional information
Add any other relevant additional information here.

Can you please share one example to using the script in an automation or script [QUESTION]

What is your question
Can you please share one example of using the script in an automation or script.

YAML configuration

# paste your configuration here
`'1596141541557':
  alias: '###New Script Off'
  sequence:
  - data:
      action: set_state_attributes
      entity_id: binary_sensor.neo_coolcam_door_sensor
      state: 'off'
    service: python_script.hass_entities``

**Screenshots**
If applicable, add your screenshots here.

**Version**
What is the version of the script?
I'm using version 1.1.0

**Additional information**
I was able to get it to work from lovelace but from an automation and script It's not working for meץ

New attribute disappears on binary_sensor after state change

What is your question
When I create a attribute on a binary_sensor that triggers the creation of the attribute, the attribute disappears after another state change of the binary sensor.

Is this by design? I would like the attribute to be permanent.

YAML configuration

---
alias: Oprit Hue
id: oprit_hue

trigger:
  - platform: state
    entity_id: binary_sensor.hue_reserve_motion_lumi
    from: "off"
    to: "on"

action:
  - service: python_script.hass_entities
    data:
      action: set_attributes
      entity_id: binary_sensor.hue_reserve_motion_lumi
      attributes: 
        - start: "{{ as_timestamp(now()) |float(0) }}"

Screenshots
Animated gif!
Screen Recording (Systeemvoorkeuren)

Version
v1.1.0

Additional information
Logfile info:

2022-05-04 10:44:50 INFO (SyncWorker_2) [homeassistant.components.python_script] Executing hass_entities.py: {'log_enabled': True, 'action': 'set_attributes', 'entity_id': 'binary_sensor.hue_reserve_motion_lumi', 'attributes': [{'start': 1651653890.053345}]}
2022-05-04 10:44:50 DEBUG (SyncWorker_2) [homeassistant.components.python_script.hass_entities.py] Python Script: hass_entities.py -> START of action: set_attributes
2022-05-04 10:44:50 DEBUG (SyncWorker_2) [homeassistant.components.python_script.hass_entities.py] Entity: 'binary_sensor.hue_reserve_motion_lumi' -> New attribute 'start': '1651653890.053345'
2022-05-04 10:44:50 DEBUG (SyncWorker_2) [homeassistant.components.python_script.hass_entities.py] DONE -> Attributes set for entity 'binary_sensor.hue_reserve_motion_lumi'
2022-05-04 10:44:50 DEBUG (SyncWorker_2) [homeassistant.components.python_script.hass_entities.py] Python Script: hass_entities.py -> END of action: set_attributes

set attribute for another entity id state

How would i set the attribute of en entity from its state

YAML configuration

alias: Tasmota Firmware Update Notification
description: ''
trigger:
  - platform: time
    at: '15:34:00'
condition: []
action:
  - service: python_script.hass_entities
    data:
      action: set_attributes
      entity_id: sensor.tasmota_latest_version
      attributes:
        - latest_version: '{{(states.sensor.latest_tasmota)}}'
mode: single

**Screenshots**
If applicable, add your screenshots here.

**Version**
What is the version of the script?

**Additional information**
Add any other relevant additional information here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.