How do you set value in a sensor and retain it.. each reboot looses it

ok thanks for your help so far… i appreciate it least the trigger part works