Oh-swiper-card + Motion sensors

Hi OH Users,

I have a few z-wave motion sensors and I would like to see the active sensor on oh-swiper-card.

At this moment I am using oh-label-card with the code below:

  label: '=(items.Ruch_WC.state == "ON") ? "WC" : (items.Ruch_wiatrolap.state
    =="ON") ? "Wiatrolap" : (items.Ruch_schody.state =="ON") ? "Schody" :
    (items.Ruch_salon.state =="ON") ? "Salon" : (items.Ruch_biuro.state =="ON")
    ? "Biuro" : "Bezruch"'

But I think that this will work better in oh-swiper-card. The swiper card needs to swipe automatically to last activated sensor. Is there there any way to do that ?

component: oh-swiper-card
config: {}
slots:
  default:
    - component: oh-label-card
      config:
        item: Ruch_WC
        title: WC
    - component: oh-label-card
      config:
        item: Ruch_biuro
        title: Biuro

Best regards,
B

FYI: The Tutorials and Examples category is for posting your own solutions, not requesting them. I’ve moved this to a more appropriate category.

I don’t believe that there is any way to do this if you are just using the pre-built oh-swiper-card.

If you build the swiper yourself from the base f7 components then, you can include a params object with the initialSlide property set to the index of the slide you want to start on.

component: f7-card
config: {}
slots:
  default:
    - component: f7-swiper
      config:
        navigation: true
        pagination: true
        params:
          initialSlide: 1
      slots:
        default:
          - component: f7-swiper-slide
...

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.