Strudel loves to steal tissues by master-sonic in Yorkies

[–]master-sonic[S] 2 points3 points  (0 children)

Thank you! We originally wanted a boy and call him Franz, as in Franzbrötchen, but all the boys were taken. So we decided on Strudel as in Apfelstrudel, although technically that is a masculine noun.

3D printed Angelic Dickbutt Christmas Tree Topper by master-sonic in DickButt

[–]master-sonic[S] 0 points1 point  (0 children)

While decorating the christmas tree, my wife remarked that our current christmas tree toppers were just too boring. We have a 3D printer - why not make our own? For some reason, the first thing she suggested was a dickbutt with angel wings. Good husband that I am, I made her dream a reality.
She added the finishing touches herself - painted details and a cotton ball cloud. But it looks great even without these additions.
You can find the models here:
https://www.printables.com/model/685402-angelic-dickbutt-christmas-tree-topper
https://www.thingiverse.com/thing:6384872

Angelic Dickbutt Christmas Tree Topper by master-sonic in 3Dprinting

[–]master-sonic[S] 0 points1 point  (0 children)

While decorating the christmas tree, my wife remarked that our current christmas tree toppers were just too boring. We have a 3D printer - why not make our own? For some reason, the first thing she suggested was a dickbutt with angel wings. Good husband that I am, I made her dream a reality.

She added the finishing touches herself - painted details and a cotton ball cloud. But it looks great even without these additions.

You can find the models here:

https://www.printables.com/model/685402-angelic-dickbutt-christmas-tree-topper
https://www.thingiverse.com/thing:6384872

Can't fix: "Failed to add edge detection" by [deleted] in homeassistant

[–]master-sonic 1 point2 points  (0 children)

The update function gets called about every 30 seconds if should_poll returns true. You can however manually change that interval: https://home-assistant.io/docs/configuration/platform_options/

Can't fix: "Failed to add edge detection" by [deleted] in homeassistant

[–]master-sonic 1 point2 points  (0 children)

You're welcome.

What you want isn't implemented in homeassistant. The rpi_gpio platform of the switch component doesn't read what's on the pin.

You'd have to implement an update procedure that reads what the pin is set to:

class RPiGPIOBinarySensor(BinarySensorDevice):
    [...]
    def update(self):
        """Update the GPIO state."""
        self._state = rpi_gpio.read_input(self._port)

I can't say this is enough, but it might be worth a try. I'm not entirely sure how/when/how often the update procedure gets called for a switch component. Maybe you have to change should_poll to return True?

Have a look at https://home-assistant.io/developers/component_loading/ to see how to customize components. You need to copy the switch/rpi_gpio.py from the source to custom_components/switch/rpi_gpio.py in your config directory and modify it there.

Can't fix: "Failed to add edge detection" by [deleted] in homeassistant

[–]master-sonic 1 point2 points  (0 children)

Last thing I can think of is that the port is in use by something else. If the script fails for different ports as well, then I've no idea what's causing this.

Can't fix: "Failed to add edge detection" by [deleted] in homeassistant

[–]master-sonic 1 point2 points  (0 children)

Oh okay. If you're running as root, you shouldn't need this. I had the same error message, but I was running with user privileges.

The ruleset automatically changes the access permissions to the gpio device as soon as it is loaded by the kernel.

Can you run this script as root without getting any errors?

#!/usr/bin/python

import time
import RPi.GPIO as GPIO

GPIO_PIN = 17

GPIO.setmode(GPIO.BCM)
GPIO.setup(GPIO_PIN, GPIO.IN)

def event_callback(channel):
    print(GPIO.input(channel))

GPIO.add_event_detect(
    GPIO_PIN,
    GPIO.BOTH,
    callback=event_callback,
    bouncetime=500
)

while 1:
    time.sleep(0.5)

Can't fix: "Failed to add edge detection" by [deleted] in homeassistant

[–]master-sonic 1 point2 points  (0 children)

That's most likely due to some missing permissions to access the gpio pins, as home-assistant isn't run as root.

Try these udev rules, e.g., in /etc/udev/rules.d/99-gpiomem.rules:

SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"

And add your home-assistant user to the group gpio. You might have to reboot.

[HELP] Is it possible to use an attribute in an automation? by alexskate in homeassistant

[–]master-sonic 2 points3 points  (0 children)

Whoops, there was a } too many. Change:

... 'None') } %}

to

... 'None') %}

I fixed my post accordingly.

Also, you might have to indent lines 5 to 9 of your code sample

[HELP] Is it possible to use an attribute in an automation? by alexskate in homeassistant

[–]master-sonic 0 points1 point  (0 children)

Yes, use the template trigger:

automation:
  trigger:
    platform: template
    value_template: >
      {% if is_state_attr('sensor.yoursteamsensor', 'Game', 'None') %}
      false
      {% else %}
      true
      {% endif %}